diff options
author | Majunath Goudar <csmanjuvijay@gmail.com> | 2013-11-13 07:10:16 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-12-08 20:53:17 -0500 |
commit | e1bffbf622ebceff411fef4970f0fa6326b45830 (patch) | |
tree | ba6726deef0c6d9e1f66b59a7aa6b0a4fbcd0eb2 /drivers/usb/host | |
parent | f625099f1a504742aef4c6ab20ba0ca981847e3c (diff) |
USB: OHCI: Properly handle OHCI controller suspend
Suspend scenario in case of OHCI was not properly
handled in ochi_suspend()routine. Alan Stern
suggested, properly handle OHCI suspend scenario.
This does generic proper handling of suspend
scenario to all OHCI SOC.
Signed-off-by: Manjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index c8e0e7637b7b..3586460fb2a1 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -1026,6 +1026,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) | |||
1026 | { | 1026 | { |
1027 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 1027 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
1028 | unsigned long flags; | 1028 | unsigned long flags; |
1029 | int rc = 0; | ||
1029 | 1030 | ||
1030 | /* Disable irq emission and mark HW unaccessible. Use | 1031 | /* Disable irq emission and mark HW unaccessible. Use |
1031 | * the spinlock to properly synchronize with possible pending | 1032 | * the spinlock to properly synchronize with possible pending |
@@ -1038,7 +1039,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) | |||
1038 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 1039 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
1039 | spin_unlock_irqrestore (&ohci->lock, flags); | 1040 | spin_unlock_irqrestore (&ohci->lock, flags); |
1040 | 1041 | ||
1041 | return 0; | 1042 | synchronize_irq(hcd->irq); |
1043 | |||
1044 | if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) { | ||
1045 | ohci_resume(hcd, false); | ||
1046 | rc = -EBUSY; | ||
1047 | } | ||
1048 | return rc; | ||
1042 | } | 1049 | } |
1043 | EXPORT_SYMBOL_GPL(ohci_suspend); | 1050 | EXPORT_SYMBOL_GPL(ohci_suspend); |
1044 | 1051 | ||