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

Commit b55867fa authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: xhci-plat: Remove usage of PM suspend/resume



Commit 57d04eb1 ("usb: xhci: add the suspend/resume functionality")
added PM suspend/resume functionality with xHCI platform driver and not
handling case when xHCI platform driver is using PM runtime suspend/resume
functionality. MSM related host mode functionality is having PM runtime
suspend/resume supported which uses same xhci_suspend() and xhci_resume()
API used with xhci_pm_suspend() and xhci_pm_resume() functionality. Fix
unclock access when system suspend context xhci_pm_suspend() is calling
xhci_suspend() as XHCI is already runtime suspended.

Change-Id: Iafbd5ef4d67dfc2cf89213e8f296f6d9ade8feab
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 494ca1d5
Loading
Loading
Loading
Loading
+1 −25
Original line number Diff line number Diff line
@@ -218,30 +218,6 @@ static int xhci_plat_remove(struct platform_device *dev)
}

#ifdef CONFIG_PM_SLEEP
static int xhci_plat_suspend(struct device *dev)
{
	struct usb_hcd	*hcd = dev_get_drvdata(dev);
	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);

	/*
	 * xhci_suspend() needs `do_wakeup` to know whether host is allowed
	 * to do wakeup during suspend. Since xhci_plat_suspend is currently
	 * only designed for system suspend, device_may_wakeup() is enough
	 * to dertermine whether host is allowed to do wakeup. Need to
	 * reconsider this when xhci_plat_suspend enlarges its scope, e.g.,
	 * also applies to runtime suspend.
	 */
	return xhci_suspend(xhci, device_may_wakeup(dev));
}

static int xhci_plat_resume(struct device *dev)
{
	struct usb_hcd	*hcd = dev_get_drvdata(dev);
	struct xhci_hcd	*xhci = hcd_to_xhci(hcd);

	return xhci_resume(xhci, 0);
}

#ifdef CONFIG_PM_RUNTIME
static int xhci_plat_runtime_idle(struct device *dev)
{
@@ -285,7 +261,7 @@ static int xhci_plat_runtime_resume(struct device *dev)
#endif

static const struct dev_pm_ops xhci_plat_pm_ops = {
	SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
	SET_SYSTEM_SLEEP_PM_OPS(NULL, NULL)
	SET_RUNTIME_PM_OPS(xhci_plat_runtime_suspend, xhci_plat_runtime_resume,
			   xhci_plat_runtime_idle)
};