提交 476e4bf9 编写于 作者: M Manjunath Goudar 提交者: Greg Kroah-Hartman

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: NManjunath Goudar <manjunath.goudar@linaro.org>
Signed-off-by: NManjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: NAlan Stern <stern@rowland.harvard.edu>
Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e81b1a6e
...@@ -1036,6 +1036,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) ...@@ -1036,6 +1036,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
{ {
struct ohci_hcd *ohci = hcd_to_ohci (hcd); struct ohci_hcd *ohci = hcd_to_ohci (hcd);
unsigned long flags; unsigned long flags;
int rc = 0;
/* Disable irq emission and mark HW unaccessible. Use /* Disable irq emission and mark HW unaccessible. Use
* the spinlock to properly synchronize with possible pending * the spinlock to properly synchronize with possible pending
...@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) ...@@ -1048,7 +1049,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
spin_unlock_irqrestore (&ohci->lock, flags); spin_unlock_irqrestore (&ohci->lock, flags);
return 0; synchronize_irq(hcd->irq);
if (do_wakeup && HCD_WAKEUP_PENDING(hcd)) {
ohci_resume(hcd, false);
rc = -EBUSY;
}
return rc;
} }
EXPORT_SYMBOL_GPL(ohci_suspend); EXPORT_SYMBOL_GPL(ohci_suspend);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册