Re: [PATCH v5 08/11] usb: dwc3: qcom: Restore VBUS override after system resume

From: Peter Chen

Date: Thu Nov 26 2026 - 04:55:24 EST


On 26-11-23 16:17:23, Faisal Hassan wrote:
> The controller reset on system resume returns the Qscratch registers to
> their power-on defaults, which clears the VBUS valid override that was
> set up for device mode. Without it the PHY does not see VBUS and the
> gadget fails to enumerate after resume.
>
> Re-enable the override after resume when the controller is not in host
> mode.
>
> Co-developed-by: Sriram Dash <sriram.dash@xxxxxxxxxxxxxxxx>
> Signed-off-by: Sriram Dash <sriram.dash@xxxxxxxxxxxxxxxx>
> Signed-off-by: Faisal Hassan <faisal.hassan@xxxxxxxxxxxxxxxx>
> ---
> drivers/usb/dwc3/dwc3-qcom.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 8e8d7e59c6d5..50fca06c83d4 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
> @@ -457,6 +457,14 @@ static int dwc3_qcom_resume(struct dwc3_qcom *qcom, pm_message_t msg)
> PWR_EVNT_LPM_IN_L2_MASK | PWR_EVNT_LPM_OUT_L2_MASK);
> }
>
> + /*
> + * The reset above returned Qscratch to its power-on defaults, so
> + * restore the VBUS valid override set up for device mode.
> + */
> + if (qcom->power_lost_in_suspend && !PMSG_IS_AUTO(msg) &&
> + !dwc3_qcom_is_host(qcom))
> + dwc3_qcom_vbus_override_enable(qcom, true);
> +
> qcom->is_suspended = false;
>

Reviewed-by: Peter Chen <peter.chen@xxxxxxxxxxxxxxxx>

--

Thanks,
Peter Chen