On Tue, Nov 04, 2003 at 04:52:05PM -0500, Alan Stern wrote:
> Greg and all:
> 
> (I've lost track of patches that have been submitted in the last few
> weeks, so it's possible that something incorporating this change is
> already somewhere in the queue.)
> 
> The usb_physical_reset_device() routine in hub.c doesn't properly set the 
> device state back to its correct value when the reset is over.  This fixes 
> that problem.
> 
> Alan Stern
> 
> 
> ===== hub.c 1.123 vs edited =====
> --- 1.123/drivers/usb/core/hub.c      Mon Sep 22 12:37:50 2003
> +++ edited/drivers/usb/core/hub.c     Tue Nov  4 15:55:56 2003
> @@ -1260,6 +1260,7 @@
>               kfree(descriptor);
>               return(-ENODEV);
>       }
> +     dev->state = USB_STATE_DEFAULT;
>  
>       /* Reprogram the Address */
>       ret = usb_set_address(dev);

Hm, doesn't hub_port_reset() already set the state of the device for us
here properly?

> @@ -1273,7 +1274,7 @@
>  
>       /* Let the SET_ADDRESS settle */
>       wait_ms(10);
> -
> +     dev->state = USB_STATE_ADDRESS;
>       up(&usb_address0_sem);
>  
>       /*

usb_set_address() already sets the state of the device to this when it
is successful.  Why set it here again?

> @@ -1342,6 +1343,7 @@
>                       dev->devpath, ret);
>               return ret;
>       }
> +     dev->state = USB_STATE_CONFIGURED;
>  
>       for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
>               struct usb_interface *intf = dev->actconfig->interface[i];

Hm, usb_set_configuration() sets this state for us, right?  But this is
on the path for when usb_set_configuration() is not called as we have a
new device now...   Hm, ok, this might be required, but can you verify
it?  Do you have any devices to test this out with?

thanks,

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to