Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: 8250_exar: Replace msleep(1) with usleep_range()

As explained in Documentation/timers/timers-howto.rst
the small amount of milliseconds sometimes produces
much longer delays.

Replace msleep(1) with usleep_range(1000, 1100).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190805142535.21948-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
3f72879e 653d00c8

+1 -1
+1 -1
drivers/tty/serial/8250/8250_exar.c
··· 180 180 tx_complete = 1; 181 181 else 182 182 tx_complete = 0; 183 - msleep(1); 183 + usleep_range(1000, 1100); 184 184 } while (!uart_circ_empty(xmit) && !tx_complete && i++ < 1000); 185 185 186 186 serial8250_do_shutdown(port);