summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/bus/usb.c6
-rw-r--r--src/drivers/usb/xhci.h6
2 files changed, 10 insertions, 2 deletions
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",
diff --git a/src/drivers/usb/xhci.h b/src/drivers/usb/xhci.h
index 303208071..5abb5caaf 100644
--- a/src/drivers/usb/xhci.h
+++ b/src/drivers/usb/xhci.h
@@ -991,9 +991,11 @@ xhci_ring_consumed ( struct xhci_trb_ring *ring ) {
/** Maximum time to wait for a command to complete
*
- * This is a policy decision.
+ * The "address device" command involves waiting for a response to a
+ * USB control transaction, and so we must wait for up to the 5000ms
+ * that USB allows for devices to respond to control transactions.
*/
-#define XHCI_COMMAND_MAX_WAIT_MS 500
+#define XHCI_COMMAND_MAX_WAIT_MS USB_CONTROL_MAX_WAIT_MS
/** Time to delay after aborting a command
*