Skip to content

Commit 409cc45

Browse files
drolevargregkh
authored andcommitted
serial: 8250_fsl: Fix TX interrupt handling condition
This is the port of the commit db1b5bc ("serial: 8250: Fix TX interrupt handling condition") to the 8250_fsl irq handling logic. 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: Andrij Abyzov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 534cf75 commit 409cc45

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/8250/8250_fsl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ int fsl8250_handle_irq(struct uart_port *port)
7878

7979
serial8250_modem_status(up);
8080

81-
if (lsr & UART_LSR_THRE)
81+
if ((lsr & UART_LSR_THRE) && (up->ier & UART_IER_THRI))
8282
serial8250_tx_chars(up);
8383

8484
up->lsr_saved_flags = orig_lsr;

0 commit comments

Comments
 (0)