Skip to contentSkip to conversation

usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

PATCH New Neil Armstrong 2 participants 4 messages May 5, 2021 – May 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

If the PHY isn't specified in the DT, -ENODATA means it should be skipped, handle it like -ENOENT.

With that, devices without USB3 supported can have USB working (Odroid-HC4).

Fixes adb049abf7 ("usb: dwc3: Add Meson G12A USB Glue")
---
 drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-meson-g12a.c +1 -1
index bd8bf227c8..90418ddc1d 100644
@@ -298,7 +298,7 @@ static int dwc3_meson_g12a_get_phys(struct dwc3_meson_g12a *priv)
 	for (i = 0 ; i < PHY_COUNT ; ++i) {
 		ret = generic_phy_get_by_name(priv->dev, phy_names[i],
 					      &priv->phys[i]);
-		if (ret == -ENOENT)
+		if (ret == -ENOENT || ret == -ENODATA)
 			continue;
 
 		if (ret)
Signature · 1 line
2.25.1
#1 lore raw

PATCH 1/1 usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

Quoted 4 lines · Neil Armstrong

If the PHY isn't specified in the DT, -ENODATA means it should be skipped, handle it like -ENOENT.

With that, devices without USB3 supported can have USB working (Odroid-HC4).

Shouldn't you rather specify NOP PHY in the DT ?

#2 lore raw

PATCH 1/1 usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

Quoted 7 lines · Marek Vasut
Quoted 4 lines · Neil Armstrong

If the PHY isn't specified in the DT, -ENODATA means it should be skipped, handle it like -ENOENT.

With that, devices without USB3 supported can have USB working (Odroid-HC4).

Shouldn't you rather specify NOP PHY in the DT ?

Who NOP I would have no idea if the port is disabled or used.
The PHY control is mixed between the actual PHY driver and the DWC3/DWC2 glue, so the bindings were designed to make some PHYs phandle optionals if unused.

Neil

#3 lore raw

PATCH 1/1 usb: dwc3-meson-g12a: skip phy on -ENODATA aswell

In reply to Neil Armstrong
Quoted 17 lines · Neil Armstrong

If the PHY isn't specified in the DT, -ENODATA means it should be skipped, handle it like -ENOENT.

With that, devices without USB3 supported can have USB working (Odroid-HC4).

Fixes adb049abf7 ("usb: dwc3: Add Meson G12A USB Glue")
---
 drivers/usb/dwc3/dwc3-meson-g12a.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/dwc3-meson-g12a.c +0 -0
index bd8bf227c8..90418ddc1d 100644

drivers/usb/dwc3/dwc3-meson-g12a.c static int dwc3_meson_g12a_get_phys(struct dwc3_meson_g12a *priv) · line 304

Quoted 8 lines
drivers/usb/dwc3/dwc3-meson-g12a.c +1 -1
@@ -298,7 +298,7 @@ static int dwc3_meson_g12a_get_phys(struct dwc3_meson_g12a *priv)
 	for (i = 0 ; i < PHY_COUNT ; ++i) {
 		ret = generic_phy_get_by_name(priv->dev, phy_names[i],
 					      &priv->phys[i]);
-		if (ret == -ENOENT)
+		if (ret == -ENOENT || ret == -ENODATA)
 			continue;
 
 		if (ret)

Applied to u-boot-amlogic

Neil