From 7297267ecb339b6b153b89377b4cba9dc4e937a8 Mon Sep 17 00:00:00 2001 From: Mayank Rana Date: Wed, 29 Apr 2020 16:43:20 -0700 Subject: [PATCH] xhci-plat: Mark usb1 and usb2 devices as wakeup source Currently usb1 and usb2 root devices are marked as wakeup capable i.e. dev->power.can_wakeup but not set as wakeup source i.e. dev->power.wakeup is NULL. When system suspend is being invoked, usb_suspend() is called from PM core context which tries to match wakeup capability with remote wakeup functionality. choose_wakeup() API gets wakeup capability using device_may_wakeup() API which return false (due to dev->power.wakeup is NULL). USB core sees this as mismatch between wakeup capability and remote wakeup functionality and resume usb1/usb2 which results into resuming USB controller (parent of those devices). Fix this issue by marking usb1 and usb2 devices as wakeup source using device_wakeup_enable() API. Change-Id: Ia858795c80f8852d696fd3c19ed442de1b3f1ac3 Signed-off-by: Mayank Rana --- drivers/usb/host/xhci-plat.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index 30d0789ed555..9058a7e08dd4 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -330,6 +330,8 @@ static int xhci_plat_probe(struct platform_device *pdev) goto dealloc_usb2_hcd; device_enable_async_suspend(&pdev->dev); + device_wakeup_enable(&xhci->shared_hcd->self.root_hub->dev); + device_wakeup_enable(&hcd->self.root_hub->dev); pm_runtime_mark_last_busy(&pdev->dev); pm_runtime_put_autosuspend(&pdev->dev);