]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: 8250: Add flag so drivers can avoid THRE probe
authorJoel Stanley <joel@jms.id.au>
Tue, 2 May 2017 07:45:42 +0000 (17:15 +0930)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 May 2017 14:19:16 +0000 (16:19 +0200)
The probing of THRE irq behaviour assumes the other end will be reading
bytes out of the buffer in order to probe the port at driver init. In
some cases the other end cannot be relied upon to read these bytes, so
provide a flag for them to skip this step.

Bit 19 was chosen as the flags are a int and the top bits are taken.

Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_port.c
include/linux/serial_core.h

index 09a65a3ec7f7df0bb3f7355fd7758d797169f960..d5b6cee87801b9b5bff5c18e3514a672aed3cec5 100644 (file)
@@ -2229,7 +2229,7 @@ int serial8250_do_startup(struct uart_port *port)
                }
        }
 
-       if (port->irq) {
+       if (port->irq && !(up->port.flags & UPF_NO_THRE_TEST)) {
                unsigned char iir1;
                /*
                 * Test for UARTs that do not reassert THRE when the
index 64d892f1e5cd833bd30003e6f64c99da3a73f5f7..1775500294bb3bab35087cca19def9fc9df2a717 100644 (file)
@@ -195,6 +195,7 @@ struct uart_port {
 #define UPF_NO_TXEN_TEST       ((__force upf_t) (1 << 15))
 #define UPF_MAGIC_MULTIPLIER   ((__force upf_t) ASYNC_MAGIC_MULTIPLIER /* 16 */ )
 
+#define UPF_NO_THRE_TEST       ((__force upf_t) (1 << 19))
 /* Port has hardware-assisted h/w flow control */
 #define UPF_AUTO_CTS           ((__force upf_t) (1 << 20))
 #define UPF_AUTO_RTS           ((__force upf_t) (1 << 21))