Skip to content
Snippets Groups Projects
Commit db1b5bc0 authored by Rautkoski Kimmo EXT's avatar Rautkoski Kimmo EXT Committed by Greg Kroah-Hartman
Browse files

serial: 8250: Fix TX interrupt handling condition


Interrupt handler checked THRE bit (transmitter holding register
empty) in LSR to detect if TX fifo is empty.
In case when there is only receive interrupts the TX handling
got called because THRE bit in LSR is set when there is no
transmission (FIFO empty). TX handling caused TX stop, which in
RS-485 half-duplex mode actually resets receiver FIFO. This is not
desired during reception because of possible data loss.

The fix is to check if THRI is set in IER in addition of the TX
fifo status. THRI in IER is set when TX is started and cleared
when TX is stopped.
This ensures that TX handling is only called when there is really
transmission on going and an interrupt for THRE and not when there
are only RX interrupts.

Signed-off-by: default avatarKimmo Rautkoski <ext-kimmo.rautkoski@vaisala.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 707aeea1
No related branches found
No related tags found
1 merge request!54Drop capacity
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment