android_kernel_xiaomi_sm8350/drivers/usb/core
Alan Stern d5d4db704b 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>
2007-05-29 13:39:07 -07:00
..
buffer.c
config.c USB: don't try to kzalloc 0 bytes 2007-05-22 23:45:50 -07:00
devices.c USB: remove use of the bus rwsem, as it doesn't really protect anything. 2007-04-27 10:57:30 -07:00
devio.c usbfs micro optimitation 2007-04-27 13:28:42 -07:00
driver.c USB: more autosuspend timer stuff 2007-05-22 23:45:49 -07:00
endpoint.c
file.c
generic.c USB: unconfigure devices which have config 0 2007-02-16 15:32:21 -08:00
hcd-pci.c
hcd.c USB: replace flush_workqueue with cancel_sync_work 2007-05-29 13:39:07 -07:00
hcd.h USB: separate autosuspend from external suspend 2007-04-27 13:28:35 -07:00
hub.c USB: replace flush_workqueue with cancel_sync_work 2007-05-29 13:39:07 -07:00
hub.h
inode.c header cleaning: don't include smp_lock.h when not used 2007-05-08 11:15:07 -07:00
Kconfig USB: make usbdevices export their device nodes instead of using a separate class 2007-04-27 13:28:37 -07:00
Makefile USB: add a blacklist for devices that can't handle some things we throw at them. 2007-02-23 15:03:46 -08:00
message.c USB: set the correct Interrupt interval in usb_bulk_msg 2007-05-22 23:45:49 -07:00
notify.c
otg_whitelist.h USB: Fix apparent typo CONFIG_USB_CDCETHER. 2007-02-16 15:32:18 -08:00
quirks.c USB: add power/level sysfs attribute 2007-04-27 13:28:37 -07:00
sysfs.c USB: handle errors in power/level attribute 2007-05-22 23:45:50 -07:00
urb.c
usb.c USB: replace flush_workqueue with cancel_sync_work 2007-05-29 13:39:07 -07:00
usb.h USB: make usbdevices export their device nodes instead of using a separate class 2007-04-27 13:28:37 -07:00