]> git.baikalelectronics.ru Git - kernel.git/commitdiff
serial: 8250: Get preserved flags using serial_lsr_in()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 8 Jun 2022 09:54:28 +0000 (12:54 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Jun 2022 11:45:08 +0000 (13:45 +0200)
serial8250_handle_irq() assumes it's the first to read LSR register.
However, there are 8250 drivers which perform LSR read in their own irq
handler prior to calling serial8250_handle_irq(). As not all flags are
preserved across LSR reads, use serial_lsr_in() helper to get all the
preserved flags.

This commit might fix other commits too besides the ones for DW UART
mentioned below. It's just not clear to me which of the other devices
clear some of the LSR flags on read. AFAIK, nobody has complained about
this problem (either against DW or other devices) so it might not have
that bad impact in the end.

Fixes: 35e274c95116 ("serial: 8250_dw: Avoid "too much work" from bogus rx timeout interrupt")
Fixes: e780dc4fd71b ("serial: 8250: dw: Add support for DMA flow controlling devices")
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220608095431.18376-4-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c

index 5a5e81dd3b7442cf6ab05db86f94e76ed011d9ef..92fb2e39134ec364acc6bacc893ede8dca597338 100644 (file)
@@ -1917,7 +1917,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
 
        spin_lock_irqsave(&port->lock, flags);
 
-       status = serial_port_in(port, UART_LSR);
+       status = serial_lsr_in(up);
 
        /*
         * If port is stopped and there are no error conditions in the