linux/drivers/usb/core
Alan Stern 455b25fb20 usbcore: make hcd_endpoint_disable wait for queue to drain
The inconsistent lock state problem in usbcore (the one that shows up
when an HCD is unloaded) comes down to two inter-related problems:

	usb_rh_urb_dequeue() isn't set up to be called with interrupts
	disabled.

	hcd_endpoint_disable() doesn't wait for all URBs on the
	endpoint's queue to complete.

The two problems are related because the one type of URB that isn't
likely to be complete when hcd_endpoint_disable() returns is a root-hub
URB.  Right now usb_rh_urb_dequeue() waits for them to complete, and it
assumes interrupts are enabled so it can wait.  But
hcd_endpoint_disable() calls it with interrupts disabled.

Now, it should be legal to unlink root-hub URBs with interrupts
disabled.  The solution is to move the waiting into
hcd_endpoint_disable(), where it belongs.  This patch (as754) does that.

It turns out to be completely safe to replace the del_timer_sync() with
a simple del_timer().  It doesn't matter if the timer routine is
running; hcd_root_hub_lock will synchronize the two threads and the
status URB will complete with an unlink error, as it should.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-27 11:58:54 -07:00
..
buffer.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
config.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
devices.c USB: Make file operations structs in drivers/usb const. 2006-09-27 11:58:52 -07:00
devio.c USB: Make file operations structs in drivers/usb const. 2006-09-27 11:58:52 -07:00
driver.c usbcore: suspending devices with no driver 2006-09-27 11:58:50 -07:00
endpoint.c [PATCH] USB: make endpoints real struct devices 2006-06-21 15:04:19 -07:00
file.c USB: Make file operations structs in drivers/usb const. 2006-09-27 11:58:52 -07:00
generic.c usbcore: fix up device and power state tests 2006-09-27 11:58:50 -07:00
hcd-pci.c USB: Properly unregister reboot notifier in case of failure in ehci hcd 2006-09-27 11:58:54 -07:00
hcd.c usbcore: make hcd_endpoint_disable wait for queue to drain 2006-09-27 11:58:54 -07:00
hcd.h USB: Properly unregister reboot notifier in case of failure in ehci hcd 2006-09-27 11:58:54 -07:00
hub.c USB: hub: Use usb_endpoint_* functions. 2006-09-27 11:58:53 -07:00
hub.h
inode.c USB: Make file operations structs in drivers/usb const. 2006-09-27 11:58:52 -07:00
Kconfig [PATCH] USB: remove devfs information from Kconfig 2006-07-12 16:03:23 -07:00
Makefile usbcore: move code among source files 2006-09-27 11:58:50 -07:00
message.c USB: usbcore get rid of the timer in usb_start_wait_urb() 2006-09-27 11:58:51 -07:00
notify.c usbfs: private mutex for open, release, and remove 2006-09-27 11:58:49 -07:00
otg_whitelist.h
sysfs.c usbcore: add configuration_string to attribute group 2006-09-27 11:58:49 -07:00
urb.c Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
usb.c USB: New functions to check endpoints info. 2006-09-27 11:58:53 -07:00
usb.h USB: Make file operations structs in drivers/usb const. 2006-09-27 11:58:52 -07:00