]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: 8250: Do not set UART_LSR_THRE in @read_status_mask
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 16 Dec 2024 17:12:42 +0000 (18:18 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2024 17:59:59 +0000 (18:59 +0100)
Since Linux 2.1.8 @read_status_mask is no longer used as a
general control of which bits are used from the LSR register.
Instead it has become an additional mask applied to
@ignore_status_mask. Since UART_LSR_THRE is never set for
@ignore_status_mask, it serves no purpose to set it for
@read_status_mask. In fact, it propagates the misconception
that @read_status_mask can be used as a general mask for LSR
bits.

Do not set UART_LSR_THRE for @read_status_mask.

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

index 9eb9aa7668118511e64d79afc11f70de4ac8369e..5290aed76a5e29311badb9f27601a575a7d38bbf 100644 (file)
@@ -412,7 +412,7 @@ static void omap_8250_set_termios(struct uart_port *port,
         */
        uart_update_timeout(port, termios->c_cflag, baud);
 
-       up->port.read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       up->port.read_status_mask = UART_LSR_OE | UART_LSR_DR;
        if (termios->c_iflag & INPCK)
                up->port.read_status_mask |= UART_LSR_FE | UART_LSR_PE;
        if (termios->c_iflag & (IGNBRK | PARMRK))
index 4d742bfb7e9a674fb08201771906d24644ace338..a5c1b069c67b2a5eee6c4faf143421eb1ed1a9fd 100644 (file)
@@ -2786,7 +2786,7 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
         */
        uart_update_timeout(port, termios->c_cflag, baud);
 
-       port->read_status_mask = UART_LSR_OE | UART_LSR_THRE | UART_LSR_DR;
+       port->read_status_mask = UART_LSR_OE | UART_LSR_DR;
        if (termios->c_iflag & INPCK)
                port->read_status_mask |= UART_LSR_FE | UART_LSR_PE;
        if (termios->c_iflag & (IGNBRK | BRKINT | PARMRK))