That "if" statement in the backup code does look a little dodgy, more
The backup code is something I never properly reviewed, so no comments
there. The tx_empty code I assumed would be a relatively rare event,
except when closing the port (at which point you don't particularly care
about errors anyway, not even the break flag since chances are you'll
miss the following character.)
Given that people might want to poll it for various reasons, I guessI think as long as you hold the port lock while you grab the LSR and
saving the status away should be done. However, there's a slight issue
with working out which character the error is associated with. Careful
locking may be the answer to that though.
As for start_tx, yes, though slightly harder to check. Maybe the codeThe version of start_tx in 2.6.21 does check IIR first, and it only
should be modified to reduce the number of potential LSR reads by reading
the IIR first, and only if that shows no interrupt pending should the LSR
be read (and the error flags remembered.)