diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index e4e6a53ebea3..fe2e0f1e66c2 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1986,16 +1986,20 @@ static bool wait_for_lsr(struct uart_8250_port *up, int bits) static void wait_for_xmitr(struct uart_8250_port *up, int bits) { unsigned int tmout; + bool tx_ready; - wait_for_lsr(up, bits); + tx_ready = wait_for_lsr(up, bits); /* Wait up to 1s for flow control if necessary */ if (uart_cons_flow_enabled(&up->port)) { for (tmout = 1000000; tmout; tmout--) { unsigned int msr = serial_in(up, UART_MSR); up->msr_saved_flags |= msr & MSR_SAVE_FLAGS; - if (msr & UART_MSR_CTS) + if (msr & UART_MSR_CTS) { + if (!tx_ready) + wait_for_lsr(up, bits); break; + } udelay(1); touch_nmi_watchdog(); }