lkml.org 
[lkml]   [2004]   [Mar]   [28]   [last100]   RSS Feed
Views: [more markup]   [less markup]   [headers]   [forward]  
 
Messages in this thread
Patch in this message
/
DateSat, 27 Mar 2004 23:12:47 -0800
FromGreg KH <>
Subject[PATCH] USB: Eliminate wait following interface unregistration
Hi,

The following patch from Alan Stern <stern@rowland.harvard.edu> 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

--- 1.73/drivers/usb/core/message.c	Wed Mar 17 14:16:47 2004
+++ edited/drivers/usb/core/message.c	Wed Mar 24 10:17:04 2004
@@ -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)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:02    [W:0.125 / U:0.830 seconds]
©2003-2008 Jasper Spaans