Loading drivers/usb/dwc3/dwc3-msm.c +15 −1 Original line number Diff line number Diff line Loading @@ -266,6 +266,7 @@ struct dwc3_msm { struct pm_qos_request pm_qos_req_dma; struct delayed_work perf_vote_work; struct delayed_work sdp_check; struct mutex suspend_resume_mutex; }; #define USB_HSPHY_3P3_VOL_MIN 3050000 /* uV */ Loading Loading @@ -2157,8 +2158,10 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) struct dwc3_event_buffer *evt; struct usb_irq *uirq; mutex_lock(&mdwc->suspend_resume_mutex); if (atomic_read(&dwc->in_lpm)) { dev_dbg(mdwc->dev, "%s: Already suspended\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading @@ -2171,6 +2174,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: %d device events pending, abort suspend\n", __func__, evt->count / 4); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } } Loading @@ -2189,6 +2193,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: cable disconnected while not in idle otg state\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } Loading @@ -2202,12 +2207,15 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) pr_err("%s(): Trying to go in LPM with state:%d\n", __func__, dwc->gadget.state); pr_err("%s(): LPM is not performed.\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } ret = dwc3_msm_prepare_suspend(mdwc); if (ret) if (ret) { mutex_unlock(&mdwc->suspend_resume_mutex); return ret; } /* Disable core irq */ if (dwc->irq) Loading Loading @@ -2315,6 +2323,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) } dev_info(mdwc->dev, "DWC3 in low power mode\n"); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading @@ -2327,8 +2336,10 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: exiting lpm\n", __func__); mutex_lock(&mdwc->suspend_resume_mutex); if (!atomic_read(&dwc->in_lpm)) { dev_dbg(mdwc->dev, "%s: Already resumed\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading Loading @@ -2479,6 +2490,8 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) msecs_to_jiffies(1000 * PM_QOS_SAMPLE_SEC)); dbg_event(0xFF, "Ctl Res", atomic_read(&dwc->in_lpm)); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading Loading @@ -3422,6 +3435,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) POWER_SUPPLY_PROP_PRESENT, &pval); } mutex_init(&mdwc->suspend_resume_mutex); /* Update initial VBUS/ID state from extcon */ if (mdwc->extcon_vbus && extcon_get_state(mdwc->extcon_vbus, EXTCON_USB)) Loading Loading
drivers/usb/dwc3/dwc3-msm.c +15 −1 Original line number Diff line number Diff line Loading @@ -266,6 +266,7 @@ struct dwc3_msm { struct pm_qos_request pm_qos_req_dma; struct delayed_work perf_vote_work; struct delayed_work sdp_check; struct mutex suspend_resume_mutex; }; #define USB_HSPHY_3P3_VOL_MIN 3050000 /* uV */ Loading Loading @@ -2157,8 +2158,10 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) struct dwc3_event_buffer *evt; struct usb_irq *uirq; mutex_lock(&mdwc->suspend_resume_mutex); if (atomic_read(&dwc->in_lpm)) { dev_dbg(mdwc->dev, "%s: Already suspended\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading @@ -2171,6 +2174,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: %d device events pending, abort suspend\n", __func__, evt->count / 4); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } } Loading @@ -2189,6 +2193,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: cable disconnected while not in idle otg state\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } Loading @@ -2202,12 +2207,15 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) pr_err("%s(): Trying to go in LPM with state:%d\n", __func__, dwc->gadget.state); pr_err("%s(): LPM is not performed.\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return -EBUSY; } ret = dwc3_msm_prepare_suspend(mdwc); if (ret) if (ret) { mutex_unlock(&mdwc->suspend_resume_mutex); return ret; } /* Disable core irq */ if (dwc->irq) Loading Loading @@ -2315,6 +2323,7 @@ static int dwc3_msm_suspend(struct dwc3_msm *mdwc) } dev_info(mdwc->dev, "DWC3 in low power mode\n"); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading @@ -2327,8 +2336,10 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) dev_dbg(mdwc->dev, "%s: exiting lpm\n", __func__); mutex_lock(&mdwc->suspend_resume_mutex); if (!atomic_read(&dwc->in_lpm)) { dev_dbg(mdwc->dev, "%s: Already resumed\n", __func__); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading Loading @@ -2479,6 +2490,8 @@ static int dwc3_msm_resume(struct dwc3_msm *mdwc) msecs_to_jiffies(1000 * PM_QOS_SAMPLE_SEC)); dbg_event(0xFF, "Ctl Res", atomic_read(&dwc->in_lpm)); mutex_unlock(&mdwc->suspend_resume_mutex); return 0; } Loading Loading @@ -3422,6 +3435,7 @@ static int dwc3_msm_probe(struct platform_device *pdev) POWER_SUPPLY_PROP_PRESENT, &pval); } mutex_init(&mdwc->suspend_resume_mutex); /* Update initial VBUS/ID state from extcon */ if (mdwc->extcon_vbus && extcon_get_state(mdwc->extcon_vbus, EXTCON_USB)) Loading