usb: hub_port_reset(): Speedup hub reset handling
Start with a short USB hub reset delay of 20ms. This can be enough for
some configurations. Switch to longer reset delay only if the short
delay hasn't been long enough.

This USB hub reset handling strategy is also used in the Linux kernel
USB hub driver, function hub_port_reset().

Without patch:

    $ time usb
    usb: USB: scanning bus for devices...
    usb: 17 USB Device(s) found
    time: 21750ms

With patch:

    $ time usb
    usb: USB: scanning bus for devices...
    usb: 17 USB Device(s) found
    time: 16355ms

Delta: ~5.5 seconds

Signed-off-by: Primoz Fiser <primoz.fiser@norik.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent cac03a8 commit 3cb8f32cf5b27edf41b21f1733c8443d06826c50
@Primoz Fiser Primoz Fiser authored on 1 Oct 2019
Sascha Hauer committed on 2 Oct 2019
Showing 1 changed file
View
drivers/usb/core/hub.c