Skip to content

Commit

Permalink
serial_core: Fix conditional start_tx on ring buffer not empty
Browse files Browse the repository at this point in the history
If the serial_core ring buffer empties just as the tty layer receives
an XOFF, then start_tx will never be called when the tty layer
receives an XON as the serial_core ring buffer is empty.  This will
possibly leave a few bytes trapped in the fifo for drivers that
disable the transmitter when flow controlled.

Signed-off-by: Seth Bollinger <sethb@digi.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Seth Bollinger authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent 4ea8daf commit 717f3bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ static void __uart_start(struct tty_struct *tty)
struct uart_state *state = tty->driver_data;
struct uart_port *port = state->uart_port;

if (!uart_circ_empty(&state->xmit) && state->xmit.buf &&
!tty->stopped && !tty->hw_stopped)
if (!tty->stopped && !tty->hw_stopped)
port->ops->start_tx(port);
}

Expand Down

0 comments on commit 717f3bb

Please sign in to comment.