From acc27b9005fcef1f51c0dd7226faa5c101aa96df Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 18 Mar 2015 16:43:18 +0000 Subject: [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 Tested-by: Robin Smidsrød Signed-off-by: Michael Brown --- src/drivers/bus/usb.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/drivers/bus') diff --git a/src/drivers/bus/usb.c b/src/drivers/bus/usb.c index 548aa7b08..54a115efc 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", -- cgit v1.2.3-55-g7522