summaryrefslogtreecommitdiffstats
path: root/net/nfs.c
diff options
context:
space:
mode:
authorPrimoz Fiser <primoz.fiser@norik.com>2019-10-01 10:18:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-10-02 08:58:10 +0200
commitb1d9837182d2b20232234adb36ada2129c3a8152 (patch)
tree110a5d7fc54d1d5f5ace85a3aeff35be4ecd1a2d /net/nfs.c
parent548625a35077a9b7b5d6c468e26e2cdeb644e80d (diff)
downloadbarebox-b1d9837182d2b20232234adb36ada2129c3a8152.tar.gz
barebox-b1d9837182d2b20232234adb36ada2129c3a8152.tar.xz
usb: Change power-on / scanning timeout handling
Change USB port scanning procedure and timeout handling in the following ways: 1) The power-on delay in usb_hub_power_on() is now reduced to a value of max(100ms, "hub->desc.bPwrOn2PwrGood * 2"). The code does not wait using mdelay, instead usb_hub_power_on() will wait before querying the device in the scanning loop later. The total connection timeout for this hub, which is (1 second + hub->desc.bPwrOn2PwrGood * 2) is calculated and will be used in the following per-port scanning loop as the timeout to detect active USB devices on this hub. 2) Don't delay the minimum delay (for power to stabilize) in usb_hub_power_on(). Instead skip querying these devices in the scanning loop usb_scan_port() until the delay time is reached. 3) The ports are now scanned in a quasi parallel way. The current code did wait for each (unconnected) port to reach its timeout and only then continue with the next port. This patch now changes this to scan all ports of all USB hubs quasi simultaneously. For this, all ports are added to a scanning list in usb_hub_configure_ports(). The list is later scanned in usb_device_list_scan() until all ports are ready by either a) reaching the connection timeout (calculated earlier), or by b) detecting a USB device. This results in a faster USB scan time as the recursive scanning of USB hubs connected to the hub that's currently being scanned will start earlier. 4) Ports with overcurrent detection will get scanned multiple times if OC condition is detected (PORT_OVERCURRENT_MAX_SCAN_COUNT). Without patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 10344ms With patch: $ time usb usb: USB: scanning bus for devices... usb: 17 USB Device(s) found time: 4529ms Delta: ~6 seconds Signed-off-by: Primoz Fiser <primoz.fiser@norik.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'net/nfs.c')
0 files changed, 0 insertions, 0 deletions