summaryrefslogtreecommitdiffstats
path: root/src/drivers/bus
diff options
context:
space:
mode:
authorMichael Brown2015-03-18 17:43:18 +0100
committerMichael Brown2015-03-18 17:43:18 +0100
commitacc27b9005fcef1f51c0dd7226faa5c101aa96df (patch)
tree9c1c577cd3f6f040deb062b5cf4fba1b34f9ca1c /src/drivers/bus
parent[netdevice] Add missing bus types to netdev_fetch_bustype() (diff)
downloadipxe-acc27b9005fcef1f51c0dd7226faa5c101aa96df.tar.gz
ipxe-acc27b9005fcef1f51c0dd7226faa5c101aa96df.tar.xz
ipxe-acc27b9005fcef1f51c0dd7226faa5c101aa96df.zip
[usb] Fix USB timeouts to match specification
Several of the USB timeouts were chosen on the principle of "pick an arbitrary but ridiculously large value, just to be safe". It turns out that some of the timeouts permitted by the USB specification are even larger: for example, control transactions are allowed to take up to five seconds to complete. Fix up these USB timeout values to match those found in the USB2 specification. Debugged-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/drivers/bus')
-rw-r--r--src/drivers/bus/usb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/bus/usb.c b/src/drivers/bus/usb.c
index 548aa7b0..54a115ef 100644
--- a/src/drivers/bus/usb.c
+++ b/src/drivers/bus/usb.c
@@ -1281,6 +1281,9 @@ static int register_usb ( struct usb_device *usb ) {
goto err_enable;
}
+ /* Allow recovery interval since port may have been reset */
+ mdelay ( USB_RESET_RECOVER_DELAY_MS );
+
/* Get device speed */
if ( ( rc = hub->driver->speed ( hub, port ) ) != 0 ) {
DBGC ( hub, "USB hub %s port %d could not get speed: %s\n",
@@ -1316,6 +1319,9 @@ static int register_usb ( struct usb_device *usb ) {
}
DBGC2 ( usb, "USB %s assigned address %d\n", usb->name, usb->address );
+ /* Allow recovery interval after Set Address command */
+ mdelay ( USB_SET_ADDRESS_RECOVER_DELAY_MS );
+
/* Read first part of device descriptor to get EP0 MTU */
if ( ( rc = usb_get_mtu ( usb, &usb->device ) ) != 0 ) {
DBGC ( usb, "USB %s could not get MTU: %s\n",