Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250-fsl: Only do the break workaround if IIR signals RLSI

It can happen that while a break is received the transmitter gets empty
and IIR signals a Transmitter holding register empty (THRI) event. In
this case it's too early for the break workaround. Still doing it then
results in the THRI event not being rereported which makes the driver
miss that and e.g. for RS485 half-duplex communication it fails to
switch back to RX mode.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20231213174312.2341013-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Uwe Kleine-König and committed by
Greg Kroah-Hartman
a5f18286 6b64f8e3

+2 -1
+2 -1
drivers/tty/serial/8250/8250_fsl.c
··· 51 51 * immediately and interrupt the CPU again. The hardware clears LSR.BI 52 52 * when the next valid char is read.) 53 53 */ 54 - if (unlikely(up->lsr_saved_flags & UART_LSR_BI)) { 54 + if (unlikely((iir & UART_IIR_ID) == UART_IIR_RLSI && 55 + (up->lsr_saved_flags & UART_LSR_BI))) { 55 56 up->lsr_saved_flags &= ~UART_LSR_BI; 56 57 port->serial_in(port, UART_RX); 57 58 uart_port_unlock_irqrestore(&up->port, flags);