On Tue, 9 Dec 2003, Greg KH wrote:
> Hm, doesn't hub_port_reset() already set the state of the device for us
> here properly?
> usb_set_address() already sets the state of the device to this when it
> is successful. Why set it here again?
In both cases, of course you are right.
> > @@ -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...
Rather, we still have the same old device and we want to keep the old
bindings.
> Hm, ok, this might be required, but can you verify
> it? Do you have any devices to test this out with?
I did verify it at the time I wrote it. While I haven't got any actual
devices that provoke this particular error-recovery pathway, it's easy to
do so when debugging a malfunctioning driver. In this case it was the
file-storage gadget (in David Brownell's gadget-2.6 tree). Because the
driver wasn't working it caused usb-storage to issue a USB port reset.
Without the patch further communication failed entirely. With the patch
it worked as well as could be expected, considering the buggy driver.
I didn't look into the subroutines when composing the patch; I just
assumed that since the third assignment was needed the first two were
needed as well. Included below is a revised patch (as131b) that leaves
out the first two assignments.
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
@@ -1342,6 +1342,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];
-------------------------------------------------------
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