serial: 8250_exar: Replace msleep(1) with usleep_range()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 5 Aug 2019 14:25:35 +0000 (17:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Sep 2019 10:43:51 +0000 (12:43 +0200)
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>
drivers/tty/serial/8250/8250_exar.c

index 873aa6b..597eb9d 100644 (file)
@@ -180,7 +180,7 @@ static void exar_shutdown(struct uart_port *port)
                        tx_complete = 1;
                else
                        tx_complete = 0;
-               msleep(1);
+               usleep_range(1000, 1100);
        } while (!uart_circ_empty(xmit) && !tx_complete && i++ < 1000);
 
        serial8250_do_shutdown(port);