From 19ca45e5ff1f42d93df018dd1e0f268dd54e62aa Mon Sep 17 00:00:00 2001 From: Ajay Agarwal Date: Mon, 16 Apr 2018 19:40:02 +0530 Subject: usb: dwc3-msm: Resume PHY before notify_connect on start_host Currently as a part of host cable connection, we are notifying cable connect to phy driver first and then resuming the PHY. This leads to bus resume case running instead of the cable connect case resume, hence the phy driver does not vote for the LDOs. As a result, PHY goes into bad state. Fix this by first resuming PHY so that cable connect case resume runs. Change-Id: Ica5b16e420c38b920688b86a24af396644487a6b Signed-off-by: Ajay Agarwal --- drivers/usb/dwc3/dwc3-msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c index 2cd600a58fd7..3f59a2f8b84f 100644 --- a/drivers/usb/dwc3/dwc3-msm.c +++ b/drivers/usb/dwc3/dwc3-msm.c @@ -3487,6 +3487,7 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on) if (on) { dev_dbg(mdwc->dev, "%s: turn on host\n", __func__); + pm_runtime_get_sync(mdwc->dev); mdwc->hs_phy->flags |= PHY_HOST_MODE; if (dwc->maximum_speed == USB_SPEED_SUPER) { mdwc->ss_phy->flags |= PHY_HOST_MODE; @@ -3495,7 +3496,6 @@ static int dwc3_otg_start_host(struct dwc3_msm *mdwc, int on) } usb_phy_notify_connect(mdwc->hs_phy, USB_SPEED_HIGH); - pm_runtime_get_sync(mdwc->dev); dbg_event(0xFF, "StrtHost gync", atomic_read(&mdwc->dev->power.usage_count)); if (!IS_ERR(mdwc->vbus_reg)) -- cgit v1.2.3