[PATCH 5/8] usb: dwc3: qcom: Add support to keep GDSC On during host mode bus suspend
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Thu Nov 26 11:18:03 PST 2026
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] usb: dwc3: qcom: GenPD hwmode not reset in dwc3_qcom_resume()
or remove
--
commit 497ba54c561a27a707fe8980a8ab1233948ec270
Author: Krishna Kurapati <krishna.kurapati at oss.qualcomm.com>
usb: dwc3: qcom: Add support to keep GDSC On during host mode bus suspend
This commit toggles GenPD hardware mode in dwc3_qcom_suspend() so the USB
GDSC stays powered during host-mode wakeup suspend and turns off otherwise.
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index 5a68025ccea5e..99dce28dda065 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
[ ... ]
> @@ -391,6 +392,9 @@ static int dwc3_qcom_suspend(struct dwc3_qcom *qcom, bool wakeup)
> for (i = 0; i < qcom->num_ports; i++)
> qcom->ports[i].usb2_speed = dwc3_qcom_read_usb2_speed(qcom, i);
> dwc3_qcom_enable_interrupts(qcom);
> + dev_pm_genpd_set_hwmode(qcom->dev, true);
> + } else {
> + dev_pm_genpd_set_hwmode(qcom->dev, false);
> }
>
> qcom->is_suspended = true;
[Severity: Medium]
Should dwc3_qcom_resume() also reset dev_pm_genpd_set_hwmode(qcom->dev,
false)?
Once a host-mode suspend enables hwmode (setting sc->hw_stay_on = true in
the GDSC), dwc3_qcom_resume() leaves it enabled while the controller is
active. If the driver is later unbound or unloaded, dwc3_qcom_remove()
resumes the device and detaches from GenPD without calling
dwc3_qcom_suspend(), so gdsc_disable() sees sc->hw_stay_on set and leaves
the GDSC powered on in hardware. If the driver is then re-probed,
genpd_add_device() reinitializes dev_gpd_data(dev)->hw_mode to false while
sc->hw_stay_on remains true, causing future dev_pm_genpd_set_hwmode(dev,
false) calls to short-circuit.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261127-usb-pcie-gdsc-suspend-v1-0-485a08ffdc6f@oss.qualcomm.com?part=5
More information about the linux-phy
mailing list