* [PATCH] usb: phy: generic: request the vbus supply only when it is described
@ 2026-10-26 14:48 hsyysy
2026-10-26 14:57 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: hsyysy @ 2026-10-26 14:48 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Yang Siyuan
From: Yang Siyuan <hsyysy@163.com>
usb_phy_gen_create_phy() unconditionally asks for an exclusive "vbus"
regulator. The legacy usb_phy_generic platform device registered by USB
glue drivers (e.g. sunxi MUSB) has no firmware node, so the lookup ends
up in the dummy-regulator path and the regulator core warns:
usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for
exclusive requests (id=vbus)
Only issue the request when the device firmware actually describes a
vbus-supply, and keep treating -ENODEV as "not present".
Signed-off-by: Yang Siyuan <hsyysy@163.com>
---
drivers/usb/phy/phy-generic.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
index de26b3023..24b7ba536 100644
--- a/drivers/usb/phy/phy-generic.c
+++ b/drivers/usb/phy/phy-generic.c
@@ -238,7 +238,17 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
return dev_err_probe(dev, PTR_ERR(nop->vcc),
"could not get vcc regulator\n");
- nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
+ /*
+ * vbus is an optional supply that only exists when the firmware
+ * describes it. The legacy usb_phy_generic devices registered by USB
+ * glue drivers have no firmware node, and requesting an exclusive
+ * dummy supply only makes the regulator core warn.
+ */
+ if (device_property_present(dev, "vbus-supply"))
+ nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
+ else
+ nop->vbus_draw = NULL;
+
if (PTR_ERR(nop->vbus_draw) == -ENODEV)
nop->vbus_draw = NULL;
if (IS_ERR(nop->vbus_draw))
base-commit: 091b06388b117fefdcb63336ac09956a4914b961
--
2.56.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: phy: generic: request the vbus supply only when it is described
2026-10-26 14:48 [PATCH] usb: phy: generic: request the vbus supply only when it is described hsyysy
@ 2026-10-26 14:57 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-10-26 14:57 UTC (permalink / raw)
To: hsyysy; +Cc: linux-usb
> From: Yang Siyuan <hsyysy@163.com>
>
> usb_phy_gen_create_phy() unconditionally asks for an exclusive "vbus"
> regulator. The legacy usb_phy_generic platform device registered by USB
> glue drivers (e.g. sunxi MUSB) has no firmware node, so the lookup ends
> up in the dummy-regulator path and the regulator core warns:
>
> usb_phy_generic usb_phy_generic.1.auto: dummy supplies not allowed for
> exclusive requests (id=vbus)
>
> Only issue the request when the device firmware actually describes a
> vbus-supply, and keep treating -ENODEV as "not present".
>
> Signed-off-by: Yang Siyuan <hsyysy@163.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261026144800.1392738-1-hsyysy@163.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-26 14:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26 14:48 [PATCH] usb: phy: generic: request the vbus supply only when it is described hsyysy
2026-10-26 14:57 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox