[U-Boot] [PATCH] common: usb: Adding delay after set configuration to support legacy devices

Marek Vasut marex at denx.de
Thu Dec 17 16:18:43 CET 2015


On Thursday, December 17, 2015 at 10:21:37 AM, Sriram Dash wrote:
> 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
> 
> Signed-off-by: Sriram Dash <sriram.dash at freescale.com>
> Signed-off-by: Rajesh Bhagat <rajesh.bhagat at freescale.com>
> ---
>  common/usb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/common/usb.c b/common/usb.c
> index 700bfc3..c624a88 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -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


More information about the U-Boot mailing list