Skip to contentSkip to conversation

USB: Eliminate wait following interface unregistration

PATCH New Greg KH 1 participant 1 message Mar 28, 2004 6 messages not in the archive USB

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Greg KH

author
#6 lore raw

PATCH 1/1 USB: Eliminate wait following interface unregistration

Hi,

The following patch from Alan Stern <[email protected]> fixes a bug in the current USB code that causes khubd to hang when a device is removed from the system, thereby preventing any future USB device changes (like adding or removing other devices) from happening.

Both Andrew and I can easily duplicate this bug against the current -bk tree.

It's not a perfect fix, but it works for now, and I will spend the next week working on restructuring the code so this is handled properly.

thanks,

greg k-h

drivers/usb/core/message.c +0 -7
@@ -794,9 +794,6 @@
 
 static void release_interface(struct device *dev)
 {
-	struct usb_interface *interface = to_usb_interface(dev);
-
-	complete(interface->released);
 }
 
 /*
@@ -828,16 +825,12 @@
 	if (dev->actconfig) {
 		for (i = 0; i < dev->actconfig->desc.bNumInterfaces; i++) {
 			struct usb_interface	*interface;
-			struct completion	intf_completion;
 
 			/* remove this interface */
 			interface = dev->actconfig->interface[i];
 			dev_dbg (&dev->dev, "unregistering interface %s\n",
 				interface->dev.bus_id);
-			init_completion (&intf_completion);
-			interface->released = &intf_completion;
 			device_unregister (&interface->dev);
-			wait_for_completion (&intf_completion);
 		}
 		dev->actconfig = 0;
 		if (dev->state == USB_STATE_CONFIGURED)