From: David Daney Date: Tue, 5 Oct 2010 18:40:07 +0000 (-0700) Subject: serial: 8250: Don't delay after transmitter is ready. X-Git-Tag: v2.6.37-rc1~155^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=97d303b7657c1a45c158d002f829ff69196c493d;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git serial: 8250: Don't delay after transmitter is ready. 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 24110f6..31b8cca 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -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) {