]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: 8250: Explain the role of @read_status_mask
authorJohn Ogness <john.ogness@linutronix.de>
Mon, 16 Dec 2024 17:12:44 +0000 (18:18 +0106)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Dec 2024 17:59:59 +0000 (18:59 +0100)
The role of @read_status_mask has changed over time and seems
to still cause confusion. This can be expected since there is
zero documentation about this driver-specific variable.

Add comments to the initialization of @read_status_mask to
clarify its role.

Signed-off-by: John Ogness <john.ogness@linutronix.de>
Link: https://lore.kernel.org/r/20241216171244.12783-5-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 10144fcc0363c54542950c14b8be8c8fc7fafb73..42b4aa56b9020edd8cb3d96ff1ab5c990675dde8 100644 (file)
@@ -412,6 +412,12 @@ static void omap_8250_set_termios(struct uart_port *port,
         */
        uart_update_timeout(port, termios->c_cflag, baud);
 
+       /*
+        * Specify which conditions may be considered for error
+        * handling and the ignoring of characters. The actual
+        * ignoring of characters only occurs if the bit is set
+        * in @ignore_status_mask as well.
+        */
        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;
index 3b9dc2bb06ebef8da5162e683d854c0483bb8fa6..1a65d3e5f3c03f5d9dcb77d5589b597570f945bd 100644 (file)
@@ -2785,6 +2785,12 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
         */
        uart_update_timeout(port, termios->c_cflag, baud);
 
+       /*
+        * Specify which conditions may be considered for error
+        * handling and the ignoring of characters. The actual
+        * ignoring of characters only occurs if the bit is set
+        * in @ignore_status_mask as well.
+        */
        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;