]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: 8250: Use @ier bits to determine if Rx is stopped
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 16 Dec 2024 17:12:41 +0000 (18:18 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2024 17:59:59 +0000 (18:59 +0100)
Commit f19c3f6c8109 ("serial: 8250_port: Don't service RX FIFO if
throttled") uses @read_status_mask (bit UART_LSR_DR) to determine
if Rx has been stopped. However, the bit UART_LSR_DR is not
managed properly in @read_status_mask for all Rx stop/start
situations and is therefore not suitable for this purpose.

Use the UART_IER_RLSI and UART_IER_RDI bits in @ier instead, as
this is already common in 8250-variants and drivers.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Link: https://lore.kernel.org/r/20241216171244.12783-2-john.ogness@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c

index 1ea52fce9bf1209da5f788990c49bf93496a5494..4d742bfb7e9a674fb08201771906d24644ace338 100644 (file)
@@ -1931,7 +1931,7 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
         */
        if (!(status & (UART_LSR_FIFOE | UART_LSR_BRK_ERROR_BITS)) &&
            (port->status & (UPSTAT_AUTOCTS | UPSTAT_AUTORTS)) &&
-           !(port->read_status_mask & UART_LSR_DR))
+           !(up->ier & (UART_IER_RLSI | UART_IER_RDI)))
                skip_rx = true;
 
        if (status & (UART_LSR_DR | UART_LSR_BI) && !skip_rx) {