From f74b9dbcf4f66bf5828b44325cf1d534c2c8a7df Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Tue, 2 Apr 2019 20:01:03 +0530 Subject: [PATCH] usb: dwc3-msm: Disable PHY wakeup IRQs on hibernation There might be spurious HS PHY IRQ after USB bus has gone into hibernation which leads to dwc3_msm_resume and in_lpm flag getting cleared. Next when the restore from hibernation happens, dwc3_msm_resume becomes a no-op but in reality, the HW resources are all turned off. This leads to an unclocked access from xhci_resume. Fix this by disabling PHY wakeup IRQs on hibernation/pm_suspend for automotive targets. Change-Id: I753fb3593fca31f12406b9126f73f75520dab1b0 Signed-off-by: Ajay Agarwal --- drivers/usb/dwc3/dwc3-msm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index a2c536cb0cd4..893337090574 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -2965,11 +2965,11 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc, bool force_power_collapse) atomic_set(&dwc->in_lpm, 1); /* - * with DCP or during cable disconnect, we dont require wakeup + * with the core in power collapse, we dont require wakeup * using HS_PHY_IRQ or SS_PHY_IRQ. Hence enable wakeup only in * case of host bus suspend and device bus suspend. */ - if (mdwc->in_device_mode || mdwc->in_host_mode) { + if (!(mdwc->lpm_flags & MDWC3_POWER_COLLAPSE)) { if (mdwc->use_pdc_interrupts) { enable_usb_pdc_interrupt(mdwc, true); } else {