On Mon, 13 Aug 2007, Alan Stern wrote:

> This patch is the wrong way to do it.  You should try this patch 
> instead.
> 
> Alan Stern
> 
> 
> Index: 2.6.22/drivers/usb/core/message.c
> ===================================================================
> --- 2.6.22.orig/drivers/usb/core/message.c
> +++ 2.6.22/drivers/usb/core/message.c
> @@ -623,12 +623,12 @@ int usb_get_descriptor(struct usb_device
>       memset(buf,0,size);     // Make sure we parse really received data
>  
>       for (i = 0; i < 3; ++i) {
> -             /* retry on length 0 or stall; some devices are flakey */
> +             /* retry on length 0 or error; some devices are flakey */
>               result = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
>                               USB_REQ_GET_DESCRIPTOR, USB_DIR_IN,
>                               (type << 8) + index, 0, buf, size,
>                               USB_CTRL_GET_TIMEOUT);
> -             if (result == 0 || result == -EPIPE)
> +             if (result <= 0)
>                       continue;

On further thought, perhaps we shouldn't retry on -ETIMEDOUT errors.

-               if (result == 0 || result == -EPIPE)
+               if (result <= 0 && result != -ETIMEDOUT)

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to