Hello, I have a system based on MPC8313ERDB here that in some situations gets stuck in an irq loop. I have a reproducer here that works reliably. A workaround is: diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 45b8a59d937c..5ab32b6ba701 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -2009,6 +2009,14 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir) status = serial_port_in(port, UART_LSR); + /* + * Sometimes a "Character time-out" (IID3:0 == 0xc) happens on MPC8313, + * but LSR doesn't report "Data ready". To clear the former the receive + * buffer must be read. It's unclear if the char read is valid or not. + */ + if ((iir & UART_IIR_ID) == UART_IIR_RX_TIMEOUT) + status |= UART_LSR_DR; + /* * If port is stopped and there are no error conditions in the * FIFO, then don't drain the FIFO, as this may lead to TTY buffer I havn't debugged that further than written in the comment but I wonder if this is a known issue (didn't find it in the errata though) and/or if someone with hardware knowledge could confirm this to be a hardware fault. Without feedback from NXP I'd look in more detail into that to for example find out the timing and so maybe more hints about the hardware and a better SW workaround/fix. Any input is very welcome. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Attachment:
signature.asc
Description: PGP signature