common: usb: Adding delay after set configuration to support legacy devices
PATCH 1/1 common: usb: Adding delay after set configuration to support legacy devices
We faced random enumeration failure issue for USB sticks on XHCI driver, specifically the legacy i.e. USB 2.0 storage devices. It seems they do not respond to a USB string descriptor submission within the allowed U-Boot timeout, which is just after sending set configuration.
USB stick where this this problem has been noticed are:
SanDisk U3 Cruzer Micro 0875530C9FC38749 (Vendor: 0x0781, Product 0x5406)
This problem has been reproduced on the Freescale LS2080A, and expected to be hit for any platform with XHCI controller using legacy USB 2.0 devices.
This patch solves the above problem by:
Adding 10 ms delay after set configuration and let the device to settle down
--- common/usb.c | 1 + 1 file changed, 1 insertion(+)
common/usb.c +1 -0
@@ -1104,6 +1104,7 @@ int usb_select_config(struct usb_device *dev) "len %d, status %lX\n", dev->act_len, dev->status);return err; } +mdelay (10 );/* Let the SET_CONFIGURATION settle */ debug ("new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n" , dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
Signature · 1 line
2.1.0
PATCH 1/1 common: usb: Adding delay after set configuration to support legacy devices
Quoted 26 lines · Sriram Dash
We faced random enumeration failure issue for USB sticks on XHCI driver, specifically the legacy i.e. USB 2.0 storage devices. It seems they do not respond to a USB string descriptor submission within the allowed U-Boot timeout, which is just after sending set configuration.
USB stick where this this problem has been noticed are:
SanDisk U3 Cruzer Micro 0875530C9FC38749 (Vendor:0x0781, Product0x5406)This problem has been reproduced on the Freescale LS2080A, and expected to be hit for any platform with XHCI controller using legacy USB 2.0 devices.
This patch solves the above problem by:
Adding 10 ms delay after set configuration and let the device to settle downSigned-off-by Sriram Dash <[email protected]>Signed-off-by Rajesh Bhagat <[email protected]>--- common/usb.c | 1 + 1 file changed, 1 insertion(+)common/usb.c +0
-0
common/usb.c int usb_select_config(struct usb_device *dev) · line 1110
Quoted 7 lines
common/usb.c +1
-0@@ -1104,6 +1104,7 @@ int usb_select_config(struct usb_device *dev) "len %d, status %lX\n", dev->act_len, dev->status);return err; } +mdelay (10 );/* Let the SET_CONFIGURATION settle */ debug ("new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n" , dev->descriptor.iManufacturer, dev->descriptor.iProduct, dev->descriptor.iSerialNumber);
I suppose this should be isolated to USB 3.0 hosts, otherwise it will cause slowdown on USB < 3.0 hosts as well and that's unwelcome.
Best regards,
Marek Vasut