aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-hcd.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-10-18 11:18:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 17:10:16 -0400
commitb8efdafb4005a79ab2305f8af31025d49292d4cf (patch)
tree730c489ddb3c786cb7b45b9adbbeed4ba81d9653 /drivers/usb/host/ehci-hcd.c
parent0a56b4fa6844f74976d4bfa4956fa6d606b392ea (diff)
USB: EHCI: add check for wakeup/suspend race
hcd-pci.c in usbcore contains a check for wakeup requests racing with controller suspend. This check is going to be moved out of usbcore and into the individual controller drivers, where it can apply to all platforms, not just PCI. This patch adds the check to ehci-hcd. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-hcd.c')
-rw-r--r--drivers/usb/host/ehci-hcd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index e66706aa9f0c..e8ba4c44223a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -1095,6 +1095,14 @@ int ehci_suspend(struct usb_hcd *hcd, bool do_wakeup)
1095 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); 1095 clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1096 spin_unlock_irq(&ehci->lock); 1096 spin_unlock_irq(&ehci->lock);
1097 1097
1098 synchronize_irq(hcd->irq);
1099
1100 /* Check for race with a wakeup request */
1101 if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
1102 ehci_resume(hcd, false);
1103 return -EBUSY;
1104 }
1105
1098 return 0; 1106 return 0;
1099} 1107}
1100EXPORT_SYMBOL_GPL(ehci_suspend); 1108EXPORT_SYMBOL_GPL(ehci_suspend);