Skip to contentSkip to conversation

usb: musb: omap2430: Propagate PHY errors from system resume

PATCH In review Pengpeng Hou 1 participant 1 message Sep 6

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

PATCH 3/3 usb: musb: omap2430: Propagate PHY errors from system resume

omap2430_resume() ignores phy_init() and phy_power_on() failures and clears phy_suspended even when the PHY is not usable.

Return initialization errors and call phy_exit() when power-on fails after a successful initialization. Clear phy_suspended only after both operations succeed.

The issue was found by our static-analysis tool and manually reviewed.

Fixes 68d9f95d6fd5 ("usb: musb: Fix suspend and resume issues for PHYs on I2C and SPI")
Assisted-by gpt 5
---
 drivers/usb/musb/omap2430.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/usb/musb/omap2430.c +10 -2
index f881455a1a23..d95ffe7a2bfb 100644
@@ -585,9 +585,17 @@ static int omap2430_resume(struct device *dev)
 {
 	struct omap2430_glue *glue = dev_get_drvdata(dev);
 	struct musb *musb = glue_to_musb(glue);
+	int ret;
+
+	ret = phy_init(musb->phy);
+	if (ret)
+		return ret;
 
-	phy_init(musb->phy);
-	phy_power_on(musb->phy);
+	ret = phy_power_on(musb->phy);
+	if (ret) {
+		phy_exit(musb->phy);
+		return ret;
+	}
 	glue->phy_suspended = 0;
 
 	return 0;
Signature · 1 line
2.50.1 (Apple Git-155)