Skip to contentSkip to conversation

usb: xhci: plat: remove error log for failure to get usb-phy

PATCH In review Stanley Chang 3 participants 3 messages May 10, 2023 – May 23, 2023

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

PATCH 1/1 usb: xhci: plat: remove error log for failure to get usb-phy

Remove this log to avoid non-error conditions.
If CONFIG_USB_PHY is disabled, the following error message appears:

[    0.231609] xhci-hcd f10f0000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)
[    0.239716] xhci-hcd f10f8000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)

In this case, devm_usb_get_phy_by_phandle is declared static inline and returns -ENXIO.

It is easy to pinpoint the failure to get the usb-phy using the debug log in drivers/usb/phy/phy.c. Therefore, it can be removed.

---
 drivers/usb/host/xhci-plat.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/host/xhci-plat.c +0 -4
index b0c8e8efc43b..6a45ee431945 100644
@@ -294,10 +294,6 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 		xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,
 			    "usb-phy", 1);
 		if (IS_ERR(xhci->shared_hcd->usb_phy)) {
-			if (PTR_ERR(xhci->shared_hcd->usb_phy) != -ENODEV)
-				dev_err(sysdev, "%s get usb3phy fail (ret=%d)\n",
-					     __func__,
-					    (int)PTR_ERR(xhci->shared_hcd->usb_phy));
 			xhci->shared_hcd->usb_phy = NULL;
 		} else {
 			ret = usb_phy_init(xhci->shared_hcd->usb_phy);
Signature · 1 line
2.34.1
Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Stanley Chang

Remove this log to avoid non-error conditions.
If CONFIG_USB_PHY is disabled, the following error message appears:
[    0.231609] xhci-hcd f10f0000.usb3: xhci_plat_probe get usb3phy fail (ret=-6) [    0.239716] xhci-hcd f10f8000.usb3: xhci_plat_probe get usb3phy fail (ret=-6) In this case, devm_usb_get_phy_by_phandle is declared static inline and returns -ENXIO.

It is easy to pinpoint the failure to get the usb-phy using the debug log in drivers/usb/phy/phy.c. Therefore, it can be removed.

Thanks, the false positives are now gone for those without CONFIG_USB_PHY.

Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Stanley Chang
Quoted 11 lines · Stanley Chang

Remove this log to avoid non-error conditions.
If CONFIG_USB_PHY is disabled, the following error message appears:

[    0.231609] xhci-hcd f10f0000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)
[    0.239716] xhci-hcd f10f8000.usb3: xhci_plat_probe get usb3phy fail (ret=-6)

In this case, devm_usb_get_phy_by_phandle is declared static inline and returns -ENXIO.

It is easy to pinpoint the failure to get the usb-phy using the debug log in drivers/usb/phy/phy.c. Therefore, it can be removed.

This one fixes the annoying bogus error messages that started showing up in 6.4-rc on the Lenovo X13s and other machines not using the legacy PHY drivers:

Fixes 9134c1fd0503 ("usb: xhci: plat: Add USB 3.0 phy support")

Greg, I noticed you applied this one for 6.5; any chance we could get this fixed already in 6.4 which has the offending commit?

Quoted 9 lines
---
 drivers/usb/host/xhci-plat.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/usb/host/xhci-plat.c +0 -0
index b0c8e8efc43b..6a45ee431945 100644

drivers/usb/host/xhci-plat.c int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s · line 299

Quoted 10 lines
drivers/usb/host/xhci-plat.c +0 -4
@@ -294,10 +294,6 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 		xhci->shared_hcd->usb_phy = devm_usb_get_phy_by_phandle(sysdev,
 			    "usb-phy", 1);
 		if (IS_ERR(xhci->shared_hcd->usb_phy)) {
-			if (PTR_ERR(xhci->shared_hcd->usb_phy) != -ENODEV)
-				dev_err(sysdev, "%s get usb3phy fail (ret=%d)\n",
-					     __func__,
-					    (int)PTR_ERR(xhci->shared_hcd->usb_phy));
 			xhci->shared_hcd->usb_phy = NULL;
 		} else {
 			ret = usb_phy_init(xhci->shared_hcd->usb_phy);

Johan