Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1bffbf6 authored by Majunath Goudar's avatar Majunath Goudar Committed by Greg Kroah-Hartman
Browse files

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: default avatarManjunath Goudar <csmanjuvijay@gmail.com>
Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Cc: linux-usb@vger.kernel.org
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f625099f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1026,6 +1026,7 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
{
	struct ohci_hcd	*ohci = hcd_to_ohci (hcd);
	unsigned long	flags;
	int		rc = 0;

	/* Disable irq emission and mark HW unaccessible. Use
	 * the spinlock to properly synchronize with possible pending
@@ -1038,7 +1039,13 @@ int ohci_suspend(struct usb_hcd *hcd, bool do_wakeup)
	clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->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);