If you've been having problems with some of your USB devices
not enumerating correctly, with "not accepting address" messages,
please give this patch a try. It resolved the problem for me, and
I could believe it would work for at least some other cases too.
- Dave
This patch lets at least some devices enumerate instead of giving the
dread (and fatal) "device not accepting address" error message.
- Be as certain as possible that usbcore cleaned up "old" state about
device address zero within the HCD. Something seems to have changed
in one of the reset/enumeration paths that prevents it from getting
scrubbed out in all the cases that need it ... causing intermittent
failures with some configurations.
- More useful diagnostics: the "new device" message says which HCD
it's using (so fewer problem reports will hide that info!), and the
"bad maxpacket" message uses the driver model diagnostics so we can
see what device had the problem (and avoid nasty long pathnames).
Signed-off-by: David Brownell <[EMAIL PROTECTED]>
--- a/drivers/usb/core/hub.c 2004-10-10 18:09:20 -07:00
+++ b/drivers/usb/core/hub.c 2004-10-10 18:09:20 -07:00
@@ -1981,6 +2013,8 @@
NULL, 0, HZ * USB_CTRL_SET_TIMEOUT);
if (retval == 0)
usb_set_device_state(udev, USB_STATE_ADDRESS);
+ usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
+ udev->epmaxpacketout[0] = udev->epmaxpacketin [0];
return retval;
}
@@ -2057,7 +2091,7 @@
udev->epmaxpacketout[0] = i;
dev_info (&udev->dev,
- "%s %s speed USB device using address %d\n",
+ "%s %s speed USB device using %s and address %d\n",
(udev->config) ? "reset" : "new",
({ char *speed; switch (udev->speed) {
case USB_SPEED_LOW: speed = "low"; break;
@@ -2065,6 +2099,7 @@
case USB_SPEED_HIGH: speed = "high"; break;
default: speed = "?"; break;
}; speed;}),
+ udev->bus->controller->driver->name,
udev->devnum);
/* Set up TT records, if needed */
--- a/drivers/usb/core/urb.c 2004-10-10 18:09:20 -07:00
+++ b/drivers/usb/core/urb.c 2004-10-10 18:09:20 -07:00
@@ -264,11 +264,10 @@
max = usb_maxpacket (dev, pipe, is_out);
if (max <= 0) {
- dbg ("%s: bogus endpoint %d-%s on usb-%s-%s (bad maxpacket %d)",
- __FUNCTION__,
- usb_pipeendpoint (pipe), is_out ? "OUT" : "IN",
- dev->bus->bus_name, dev->devpath,
- max);
+ dev_dbg(&dev->dev,
+ "bogus endpoint ep%d%s in %s (bad maxpacket %d)",
+ usb_pipeendpoint (pipe), is_out ? "out" : "in",
+ __FUNCTION__, max);
return -EMSGSIZE;
}