On Wed, 6 Jul 2011, Éric Piel wrote: > Hello, > It seems I'm very unlucky this week and I've come across to what looks > like a second regression in the kernel. I'm running a version few > commits after 3.0-rc6, which includes commit e534c5b831c8 "fix > regression occurring during device removal". > > When I plug/unplug/plug a mobile phone, after waiting a few minutes I > get a "task khubd:621 blocked for more than 120 seconds." Note that it's > directly connected to my laptop, not via an external hub (although the > bug also happens with an external hub). > > Below is the whole dmesg log (with usb debug messages on) > > Let me know if you need me to investigate more, or maybe there is > already a fix for that bug? Ah -- this stack dump points out the reason for the hang. It looks like that "fix regression..." commit didn't go far enough; I neglected the fact that interfaces can be unbound out of order when a driver claims multiple interfaces. Adding this patch on top of that commit should fix this. Let me know what you both get. Alan Stern drivers/usb/core/message.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Index: usb-3.0/drivers/usb/core/message.c =================================================================== --- usb-3.0.orig/drivers/usb/core/message.c +++ usb-3.0/drivers/usb/core/message.c @@ -1147,6 +1147,14 @@ void usb_disable_device(struct usb_devic * any drivers bound to them (a key side effect) */ if (dev->actconfig) { + /* + * FIXME: In order to avoid self-deadlock involving the + * bandwidth_mutex, we have to mark all the interfaces + * before unregistering any of them. + */ + for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) + dev->actconfig->interface[i]->unregistering = 1; + for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) { struct usb_interface *interface; @@ -1156,7 +1164,6 @@ void usb_disable_device(struct usb_devic continue; dev_dbg(&dev->dev, "unregistering interface %s\n", dev_name(&interface->dev)); - interface->unregistering = 1; remove_intf_ep_devs(interface); device_del(&interface->dev); } -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html