Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: dwc3: meson: g12a: disable vbus on removal
@ 2026-11-19  8:15 Wang Haoran
  2026-11-19  8:26 ` sashiko-bot
  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.


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-19  8:27 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-11-19  8:26 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox