[PATCH] usb: dwc3: meson: g12a: disable vbus on removal
From: Wang Haoran
Date: Thu Nov 19 2026 - 03:17:01 EST
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@xxxxxxxxxxxxxxxxxx>
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.