[PATCH v3 06/12] phy: qualcomm: qcom-uniphy-pcie-usb3-28lp: Improve error handling in power_on
From: George Moussalem via B4 Relay
Date: Tue Aug 25 2026 - 08:40:11 EST
From: George Moussalem <george.moussalem@xxxxxxxxxxx>
When the PHY fails the enable clocks, it leaves the PHY out of reset.
Fix this by asserting the reset before returning the error.
In addition, language correct the error messages.
Signed-off-by: George Moussalem <george.moussalem@xxxxxxxxxxx>
---
drivers/phy/qualcomm/phy-qcom-uniphy-pcie-usb3-28lp.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-usb3-28lp.c b/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-usb3-28lp.c
index 671bb805057f..d25ae9d8b9e7 100644
--- a/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-usb3-28lp.c
+++ b/drivers/phy/qualcomm/phy-qcom-uniphy-pcie-usb3-28lp.c
@@ -144,7 +144,7 @@ static int qcom_uniphy_pcie_usb3_power_on(struct phy *x)
ret = reset_control_bulk_assert(phy->num_resets, phy->resets);
if (ret) {
- dev_err(phy->dev, "reset assert failed (%d)\n", ret);
+ dev_err(phy->dev, "failed to assert reset: %d\n", ret);
return ret;
}
@@ -152,7 +152,7 @@ static int qcom_uniphy_pcie_usb3_power_on(struct phy *x)
ret = reset_control_bulk_deassert(phy->num_resets, phy->resets);
if (ret) {
- dev_err(phy->dev, "reset deassert failed (%d)\n", ret);
+ dev_err(phy->dev, "failed to deassert reset: %d\n", ret);
return ret;
}
@@ -160,8 +160,8 @@ static int qcom_uniphy_pcie_usb3_power_on(struct phy *x)
ret = clk_bulk_prepare_enable(phy->num_clks, phy->clks);
if (ret) {
- dev_err(phy->dev, "clk prepare and enable failed %d\n", ret);
- return ret;
+ dev_err(phy->dev, "failed to enable clocks: %d\n", ret);
+ goto err_assert_resets;
}
usleep_range(CLK_EN_DELAY_MIN_US, CLK_EN_DELAY_MAX_US);
@@ -169,6 +169,11 @@ static int qcom_uniphy_pcie_usb3_power_on(struct phy *x)
qcom_uniphy_pcie_usb3_init(phy);
return 0;
+
+err_assert_resets:
+ reset_control_bulk_assert(phy->num_resets, phy->resets);
+
+ return ret;
}
static inline int qcom_uniphy_pcie_usb3_get_resources(struct platform_device *pdev,
--
2.53.0