usb/host/fotg210: replace msleep by usleep_range
authorPeter Senna Tschudin <peter.senna@gmail.com>
Mon, 12 Oct 2015 21:22:37 +0000 (23:22 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Oct 2015 06:46:27 +0000 (23:46 -0700)
msleep under 20ms can result in sleeping up to 20ms, which may not be
intended. Replace msleep(5) by usleep_range(5000, 10000). The range of 5
ms is to reduce the chances of creating an interrupt while reducing the
maximum wait time in 50%.

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/fotg210-hcd.c

index 6ef830809c8d36138a5864ef9443c0a92a408c44..f3c1a718fe0b66e1b83b10d26887b2f3264429a3 100644 (file)
@@ -5085,7 +5085,7 @@ static int fotg210_run(struct usb_hcd *hcd)
        fotg210->rh_state = FOTG210_RH_RUNNING;
        /* unblock posted writes */
        fotg210_readl(fotg210, &fotg210->regs->command);
-       msleep(5);
+       usleep_range(5000, 10000);
        up_write(&ehci_cf_port_reset_rwsem);
        fotg210->last_periodic_enable = ktime_get_real();