]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: Fix send_xchar() handlers
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 2 Sep 2014 21:39:15 +0000 (17:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Sep 2014 23:22:42 +0000 (16:22 -0700)
START_CHAR() & STOP_CHAR() can be disabled if set to '\0'
(__DISABLED_CHAR).  UART drivers which define a send_xchar()
handler must not transmit __DISABLED_CHAR.

Document requirement.

Affected drivers:
sunsab
sunhv

cc: David S. Miller <davem@davemloft.net>
cc: <sparclinux@vger.kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/serial/driver
drivers/tty/serial/sunhv.c
drivers/tty/serial/sunsab.c

index 3bba1aeb799c311c6a9ce735097a0a7f64ef24d3..ba64e4b892e913cb4d1ff4cc2741d9f6f422c633 100644 (file)
@@ -140,6 +140,8 @@ hardware.
        will append the character to the circular buffer and then call
        start_tx() / stop_tx() to flush the data out.
 
+       Do not transmit if ch == '\0' (__DISABLED_CHAR).
+
        Locking: none.
        Interrupts: caller dependent.
 
index 20521db2189fbe3fcebd1e2583bb80b946d87f5e..25d43ce8b3187f89921de1ca59b2baefd6a81729 100644 (file)
@@ -268,6 +268,9 @@ static void sunhv_send_xchar(struct uart_port *port, char ch)
        unsigned long flags;
        int limit = 10000;
 
+       if (ch == __DISABLED_CHAR)
+               return;
+
        spin_lock_irqsave(&port->lock, flags);
 
        while (limit-- > 0) {
index b9598b227a45b887b591fa724b8000912ae3404d..0af75f8b98a49009260fded27f76248e14165881 100644 (file)
@@ -468,6 +468,9 @@ static void sunsab_send_xchar(struct uart_port *port, char ch)
        struct uart_sunsab_port *up = (struct uart_sunsab_port *) port;
        unsigned long flags;
 
+       if (ch == __DISABLED_CHAR)
+               return;
+
        spin_lock_irqsave(&up->port.lock, flags);
 
        sunsab_tec_wait(up);