]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
serial: sunsab: Don't enable tx if tx stopped
authorPeter Hurley <peter@hurleysoftware.com>
Tue, 2 Sep 2014 21:39:17 +0000 (17:39 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Sep 2014 23:22:42 +0000 (16:22 -0700)
The serial core may call the UART driver's start_tx() even if
tx is stopped; the UART driver must verify tx should be enabled
before transmitting.

Reported-by: Sam Ravnborg <sam@ravnborg.org>
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>
drivers/tty/serial/sunsab.c

index 0af75f8b98a49009260fded27f76248e14165881..b339fe4811cd31f80433d8562dc8916fdf6f0689 100644 (file)
@@ -436,7 +436,7 @@ static void sunsab_start_tx(struct uart_port *port)
        struct circ_buf *xmit = &up->port.state->xmit;
        int i;
 
-       if (uart_circ_empty(xmit))
+       if (uart_circ_empty(xmit) || uart_tx_stopped(port))
                return;
 
        up->interrupt_mask1 &= ~(SAB82532_IMR1_ALLS|SAB82532_IMR1_XPR);