All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: qcom: m31-eusb2: Fix return value of init call
@ 2026-07-18  9:31 ` Krishna Kurapati
  0 siblings, 0 replies; 3+ messages in thread
From: Krishna Kurapati @ 2026-07-18  9:31 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Wesley Cheng, Melody Olvera,
	Dmitry Baryshkov
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krishna Kurapati

The init call currently returns success irrespective of any failures
during repeater init or clock enablement. Return appropriate error value
in the init call failure path.

Fixes: 9c8504861cc4 ("phy: qcom: Add M31 based eUSB2 PHY driver")
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
index 0bec8657149c..275df38256de 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
@@ -221,7 +221,7 @@ static int m31eusb2_phy_init(struct phy *uphy)
 disable_vreg:
 	regulator_bulk_disable(M31_EUSB_NUM_VREGS, phy->vregs);
 
-	return 0;
+	return ret;
 }
 
 static int m31eusb2_phy_exit(struct phy *uphy)

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260718-m31-eusb2-fix-666cf8c5a72c

Best regards,
--  
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] phy: qcom: m31-eusb2: Fix return value of init call
@ 2026-07-18  9:31 ` Krishna Kurapati
  0 siblings, 0 replies; 3+ messages in thread
From: Krishna Kurapati @ 2026-07-18  9:31 UTC (permalink / raw)
  To: Vinod Koul, Neil Armstrong, Wesley Cheng, Melody Olvera,
	Dmitry Baryshkov
  Cc: linux-arm-msm, linux-phy, linux-kernel, Krishna Kurapati

The init call currently returns success irrespective of any failures
during repeater init or clock enablement. Return appropriate error value
in the init call failure path.

Fixes: 9c8504861cc4 ("phy: qcom: Add M31 based eUSB2 PHY driver")
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
 drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
index 0bec8657149c..275df38256de 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
@@ -221,7 +221,7 @@ static int m31eusb2_phy_init(struct phy *uphy)
 disable_vreg:
 	regulator_bulk_disable(M31_EUSB_NUM_VREGS, phy->vregs);
 
-	return 0;
+	return ret;
 }
 
 static int m31eusb2_phy_exit(struct phy *uphy)

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260718-m31-eusb2-fix-666cf8c5a72c

Best regards,
--  
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] phy: qcom: m31-eusb2: Fix return value of init call
  2026-07-18  9:31 ` Krishna Kurapati
  (?)
@ 2026-07-18  9:36 ` sashiko-bot
  -1 siblings, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-07-18  9:36 UTC (permalink / raw)
  To: Krishna Kurapati; +Cc: vkoul, neil.armstrong, olteanv, linux-phy

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Hardware initialization failures during register configuration in `m31eusb2_phy_init` are ignored, leading to a silent failure.
--

--- Patch [1]: [PATCH] phy: qcom: m31-eusb2: Fix return value of init call ---
commit 65f666fe30cbc54b37ee682f3064a24fcc24b16f
Author: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>

phy: qcom: m31-eusb2: Fix return value of init call
    
The init call previously returned 0 even when repeater initialization or clock
enablement failed. This patch updates the failure path to return the actual
error value.

> diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
> index 0bec8657149c9..275df38256de3 100644
> --- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
> +++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
[ ... ]
>  	m31eusb2_phy_write_sequence(phy, data->setup_seq, data->setup_seq_nregs);
>  	m31eusb2_phy_write_readback(phy->base,
>  				    USB_PHY_HS_PHY_CTRL_COMMON0, FSEL,
>  				    FIELD_PREP(FSEL, data->fsel));
>  	m31eusb2_phy_write_sequence(phy, data->override_seq, data->override_seq_nregs);
>  	m31eusb2_phy_write_sequence(phy, data->reset_seq, data->reset_seq_nregs);
>  
>  	return 0;

[Severity: High]
This is a pre-existing issue, but since this patch fixes error handling in 
m31eusb2_phy_init(), should we also check the return values of these register 
configuration functions?

If m31eusb2_phy_write_sequence() or m31eusb2_phy_write_readback() fails, the 
error is currently ignored. The function successfully returns 0 without 
executing the disable_repeater and disable_vreg cleanup paths. This could leave 
the PHY hardware in an incorrectly initialized state.

>  
>  disable_repeater:
>  	phy_exit(phy->repeater);
>  disable_vreg:
>  	regulator_bulk_disable(M31_EUSB_NUM_VREGS, phy->vregs);
>  
> -	return 0;
> +	return ret;
>  }

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260718-m31-eusb2-fix-v1-1-8588a1b94d76@oss.qualcomm.com?part=1

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-07-18  9:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-18  9:31 [PATCH] phy: qcom: m31-eusb2: Fix return value of init call Krishna Kurapati
2026-07-18  9:31 ` Krishna Kurapati
2026-07-18  9:36 ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.