[PATCH] phy: qcom: m31: propagate reset errors

Pengpeng Hou posted 1 patch 3 weeks, 6 days ago
drivers/phy/qualcomm/phy-qcom-m31.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
[PATCH] phy: qcom: m31: propagate reset errors
Posted by Pengpeng Hou 3 weeks, 6 days ago
m31usb_phy_init() enables the regulator and clock, then performs an
unchecked
reset pulse before reporting that the PHY powered on.

Return reset-controller errors and release the clock and regulator that
were
enabled for the failed power-on attempt.

Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
 drivers/phy/qualcomm/phy-qcom-m31.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-m31.c b/drivers/phy/qualcomm/phy-qcom-m31.c
index 168ea980fda03..f46c7ec87496a 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31.c
@@ -228,9 +228,14 @@ static int m31usb_phy_init(struct phy *phy)
 	}
 
 	/* Perform phy reset */
-	reset_control_assert(qphy->reset);
+	ret = reset_control_assert(qphy->reset);
+	if (ret)
+		goto disable_clk;
+
 	udelay(5);
-	reset_control_deassert(qphy->reset);
+	ret = reset_control_deassert(qphy->reset);
+	if (ret)
+		goto disable_clk;
 
 	/* configure for ULPI mode if requested */
 	if (qphy->ulpi_mode)
@@ -247,6 +252,12 @@ static int m31usb_phy_init(struct phy *phy)
 	}
 
 	return 0;
+
+disable_clk:
+	clk_disable_unprepare(qphy->clk);
+	regulator_disable(qphy->vreg);
+
+	return ret;
 }
 
 static int m31usb_phy_shutdown(struct phy *phy)

base-commit: 08dbfad3f5040f5bdb6c529da20d6d4e81fefd72
-- 
2.50.1
Re: [PATCH] phy: qcom: m31: propagate reset errors
Posted by Krishna Kurapati 3 weeks, 4 days ago

On 8/30/2026 6:44 PM, Pengpeng Hou wrote:
> m31usb_phy_init() enables the regulator and clock, then performs an
> unchecked
> reset pulse before reporting that the PHY powered on.
> 
> Return reset-controller errors and release the clock and regulator that
> were
> enabled for the failed power-on attempt.
> 
> Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Incase you put a second version, please fix the commit message formatting.

Reviewed-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
Re: [PATCH] phy: qcom: m31: propagate reset errors
Posted by Abel Vesa 3 weeks, 4 days ago
On 26-08-30 21:14:42, Pengpeng Hou wrote:
> m31usb_phy_init() enables the regulator and clock, then performs an
> unchecked
> reset pulse before reporting that the PHY powered on.
> 
> Return reset-controller errors and release the clock and regulator that
> were
> enabled for the failed power-on attempt.
> 
> Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>

Reviewed-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Re: [PATCH] phy: qcom: m31: propagate reset errors
Posted by Konrad Dybcio 3 weeks, 4 days ago
On 8/30/26 3:14 PM, Pengpeng Hou wrote:
> m31usb_phy_init() enables the regulator and clock, then performs an
> unchecked
> reset pulse before reporting that the PHY powered on.
> 
> Return reset-controller errors and release the clock and regulator that
> were
> enabled for the failed power-on attempt.
> 
> Fixes: 08e49af50701 ("phy: qcom: Introduce M31 USB PHY driver")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad