usb: dwc3-msm: Release PM wakelock in host mode only for auto targets

Currently the driver releases PM wakelock in host mode. This
causes pm_suspend to get triggered. Although pm_suspend bails out
but xhci_bus_suspend transitions the bus to a bad state leading
to host mode failure.
Fix this by releasing wakelock only for targets on which we allow
PM suspend in host mode irrespective of runtimePM.

Change-Id: I6648991272c0f22b032b526bce3a76864fec63a5
Signed-off-by: Ajay Agarwal <ajaya@codeaurora.org>
This commit is contained in:
Ajay Agarwal 2018-09-26 17:12:10 +05:30 committed by Gerrit - the friendly Code Review server
parent 6aa022f4eb
commit 4cda48e92c

View file

@ -3969,7 +3969,10 @@ static void dwc3_otg_sm_work(struct work_struct *w)
mdwc->otg_state = OTG_STATE_A_IDLE;
goto ret;
}
pm_wakeup_event(mdwc->dev, DWC3_WAKEUP_SRC_TIMEOUT);
if (mdwc->no_wakeup_src_in_hostmode) {
pm_wakeup_event(mdwc->dev,
DWC3_WAKEUP_SRC_TIMEOUT);
}
}
break;
@ -3987,7 +3990,10 @@ static void dwc3_otg_sm_work(struct work_struct *w)
dbg_event(0xFF, "XHCIResume", 0);
if (dwc)
pm_runtime_resume(&dwc->xhci->dev);
pm_wakeup_event(mdwc->dev, DWC3_WAKEUP_SRC_TIMEOUT);
if (mdwc->no_wakeup_src_in_hostmode) {
pm_wakeup_event(mdwc->dev,
DWC3_WAKEUP_SRC_TIMEOUT);
}
}
break;