aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2007-05-29 16:34:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-29 13:39:07 -0700
commitd5d4db704b962773c03ee3beb3258b6450611e66 (patch)
treefc0ffd83dff3a4bd19a33ba6c2af73cfd4de7da4 /drivers/usb/core/usb.c
parentLinux 2.6.22-rc3 (diff)
downloadlinux-dev-d5d4db704b962773c03ee3beb3258b6450611e66.tar.xz
linux-dev-d5d4db704b962773c03ee3beb3258b6450611e66.zip
USB: replace flush_workqueue with cancel_sync_work
This patch (as912) replaces a couple of calls to flush_workqueue() with cancel_sync_work() and cancel_rearming_delayed_work(). Using a more directed approach allows us to avoid some nasty deadlocks. The prime example occurs when a first-level device (the parent is a root hub) is removed while at the same time the root hub gets a remote wakeup request. khubd would try to flush the autosuspend workqueue while holding the root-hub's lock, and the remote-wakeup workqueue routine would be waiting to lock the root hub. The patch also reorganizes the power management portion of usb_disconnect(), separating it out into its own routine. The autosuspend workqueue entry is cancelled immediately instead of waiting for the device's release routine. In addition, synchronization with the autosuspend thread is carried out even for root hubs (an oversight in the original code). Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Greg KH <gregkh@suse.de> Cc: Mark Lord <lkml@rtr.ca> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--drivers/usb/core/usb.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 80627b6a2bf9..4a6299bd0047 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -184,10 +184,6 @@ static void usb_release_dev(struct device *dev)
udev = to_usb_device(dev);
-#ifdef CONFIG_USB_SUSPEND
- cancel_delayed_work(&udev->autosuspend);
- flush_workqueue(ksuspend_usb_wq);
-#endif
usb_destroy_configuration(udev);
usb_put_hcd(bus_to_hcd(udev->bus));
kfree(udev->product);