aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorDavid Daney <ddaney@caviumnetworks.com>2010-10-05 14:40:07 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-22 13:20:06 -0400
commit97d303b7657c1a45c158d002f829ff69196c493d (patch)
treead796eebea4bb22064e87dde1518ca935cca2dcd /drivers/serial
parentfd8b6cb4d820c4a717af1a0ac3ee387fd84571cf (diff)
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 <ddaney@caviumnetworks.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 24110f6f61e0..31b8cca179cd 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)
1867 unsigned int status, tmout = 10000; 1867 unsigned int status, tmout = 10000;
1868 1868
1869 /* Wait up to 10ms for the character(s) to be sent. */ 1869 /* Wait up to 10ms for the character(s) to be sent. */
1870 do { 1870 for (;;) {
1871 status = serial_in(up, UART_LSR); 1871 status = serial_in(up, UART_LSR);
1872 1872
1873 up->lsr_saved_flags |= status & LSR_SAVE_FLAGS; 1873 up->lsr_saved_flags |= status & LSR_SAVE_FLAGS;
1874 1874
1875 if ((status & bits) == bits)
1876 break;
1875 if (--tmout == 0) 1877 if (--tmout == 0)
1876 break; 1878 break;
1877 udelay(1); 1879 udelay(1);
1878 } while ((status & bits) != bits); 1880 }
1879 1881
1880 /* Wait up to 1s for flow control if necessary */ 1882 /* Wait up to 1s for flow control if necessary */
1881 if (up->port.flags & UPF_CONS_FLOW) { 1883 if (up->port.flags & UPF_CONS_FLOW) {