* [PATCH] usb: dwc3: meson: g12a: disable vbus on removal
@ 2026-11-19 8:15 Wang Haoran
2026-12-04 19:31 ` Thinh Nguyen
0 siblings, 1 reply; 2+ messages in thread
From: Wang Haoran @ 2026-11-19 8:15 UTC (permalink / raw)
To: Thinh.Nguyen, gregkh, neil.armstrong, khilman
Cc: jbrunet, martin.blumenstingl, linux-usb, linux-arm-kernel,
linux-amlogic, linux-kernel, wanghr2026
dwc3_meson_g12a_probe() enables the vbus regulator, but the remove path
neither disables it nor runs the suspend callback (pm_runtime_disable +
pm_runtime_set_suspended short-circuits it), so VBUS stays powered after
the driver is detached. The probe error path already unwinds the regulator,
so this is simply the missing remove-side counterpart: the USB port keeps
supplying 5V to an attached device even after the glue driver is unbound.
Disable vbus in the remove path to match probe.
Signed-off-by: Wang Haoran <wanghr2026@mail.zgclab.edu.cn>
Fixes: c99993376f72 ("usb: dwc3: Add Amlogic G12A DWC3 glue")
---
diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
index ca07e813fd64..4d68b50722e7 100644
--- a/drivers/usb/dwc3/dwc3-meson-g12a.c
+++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
@@ -847,6 +847,9 @@ static void dwc3_meson_g12a_remove(struct platform_device *pdev)
phy_exit(priv->phys[i]);
}
+ if (priv->vbus)
+ regulator_disable(priv->vbus);
+
pm_runtime_disable(dev);
pm_runtime_put_noidle(dev);
pm_runtime_set_suspended(dev);
---
The vulnerability was found by static analysis.
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] usb: dwc3: meson: g12a: disable vbus on removal
2026-11-19 8:15 [PATCH] usb: dwc3: meson: g12a: disable vbus on removal Wang Haoran
@ 2026-12-04 19:31 ` Thinh Nguyen
0 siblings, 0 replies; 2+ messages in thread
From: Thinh Nguyen @ 2026-12-04 19:31 UTC (permalink / raw)
To: Wang Haoran
Cc: Thinh Nguyen, gregkh@linuxfoundation.org,
neil.armstrong@linaro.org, khilman@baylibre.com,
jbrunet@baylibre.com, martin.blumenstingl@googlemail.com,
linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
On Thu, Nov 19, 2026, Wang Haoran wrote:
> dwc3_meson_g12a_probe() enables the vbus regulator, but the remove path
> neither disables it nor runs the suspend callback (pm_runtime_disable +
> pm_runtime_set_suspended short-circuits it), so VBUS stays powered after
> the driver is detached. The probe error path already unwinds the regulator,
> so this is simply the missing remove-side counterpart: the USB port keeps
> supplying 5V to an attached device even after the glue driver is unbound.
>
> Disable vbus in the remove path to match probe.
>
> Signed-off-by: Wang Haoran <wanghr2026@mail.zgclab.edu.cn>
> Fixes: c99993376f72 ("usb: dwc3: Add Amlogic G12A DWC3 glue")
> ---
>
Please address Sashiko's review.
Thanks,
Thinh
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 19:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 8:15 [PATCH] usb: dwc3: meson: g12a: disable vbus on removal Wang Haoran
2026-12-04 19:31 ` Thinh Nguyen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox