]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB: Eliminate wait following interface unregistration
authorGreg Kroah-Hartman <greg@kroah.com>
Sun, 28 Mar 2004 03:16:38 +0000 (19:16 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 28 Mar 2004 03:16:38 +0000 (19:16 -0800)
This 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.

drivers/usb/core/message.c

index 5bd4d8ab05ad5f47e3fed3a4b173b530388486c8..63aff4a261061b1429ff8635357cd8ef18de79a5 100644 (file)
@@ -794,9 +794,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf)
 
 static void release_interface(struct device *dev)
 {
-       struct usb_interface *interface = to_usb_interface(dev);
-
-       complete(interface->released);
 }
 
 /*
@@ -828,16 +825,12 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
        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)