mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[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>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user