Skip to content

Commit

Permalink
serial: 8250: Don't delay after transmitter is ready.
Browse files Browse the repository at this point in the history
The loop in wait_for_xmitr() is delaying one extra uS after the ready
condition has been met.  Rewrite the loop to only delay if the
transmitter is not ready.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
David Daney authored and Greg Kroah-Hartman committed Oct 22, 2010
1 parent fd8b6cb commit 97d303b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/serial/8250.c
Original file line number Diff line number Diff line change
Expand Up @@ -1867,15 +1867,17 @@ static void wait_for_xmitr(struct uart_8250_port *up, int bits)
unsigned int status, tmout = 10000;

/* Wait up to 10ms for the character(s) to be sent. */
do {
for (;;) {
status = serial_in(up, UART_LSR);

up->lsr_saved_flags |= status & LSR_SAVE_FLAGS;

if ((status & bits) == bits)
break;
if (--tmout == 0)
break;
udelay(1);
} while ((status & bits) != bits);
}

/* Wait up to 1s for flow control if necessary */
if (up->port.flags & UPF_CONS_FLOW) {
Expand Down

0 comments on commit 97d303b

Please sign in to comment.