aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-06-09 17:34:27 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-10 17:35:33 -0400
commitc548795abe0d3520b74e18f23ca0a0d72deddab9 (patch)
treefc9c29119b6d811ff28c3dfbdd03600ff80ea11d /drivers
parent6d88e6792574497bfac9a81403cc47712040636f (diff)
USB: add check to detect host controller hardware removal
This patch (as1391) fixes a problem that can occur when USB host controller hardware is hot-unplugged. If no interrupts are generated by the unplug then the HCD may not realize that the controller is gone, and the subsequent unbind may hang waiting for interrupts that never arrive. The solution (for PCI-based controllers) is to call the HCD's interrupt handler at the start of usb_hcd_pci_remove(). If the hardware is gone, the handler will realize this when it tries to read the controller's status register. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/core/hcd-pci.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
index 1cf2d1e79a5c..7e2d5271b0c9 100644
--- a/drivers/usb/core/hcd-pci.c
+++ b/drivers/usb/core/hcd-pci.c
@@ -292,6 +292,14 @@ void usb_hcd_pci_remove(struct pci_dev *dev)
292 if (!hcd) 292 if (!hcd)
293 return; 293 return;
294 294
295 /* Fake an interrupt request in order to give the driver a chance
296 * to test whether the controller hardware has been removed (e.g.,
297 * cardbus physical eject).
298 */
299 local_irq_disable();
300 usb_hcd_irq(0, hcd);
301 local_irq_enable();
302
295 usb_remove_hcd(hcd); 303 usb_remove_hcd(hcd);
296 if (hcd->driver->flags & HCD_MEMORY) { 304 if (hcd->driver->flags & HCD_MEMORY) {
297 iounmap(hcd->regs); 305 iounmap(hcd->regs);