[PATCH v6 1/4] phy: ti-pipe3: Fix ignored clock enable return value in init

Manivannan Sadhasivam mani at kernel.org
Wed Sep 9 00:41:06 PDT 2026


On Fri, Jun 19, 2026 at 11:02:11AM +0800, Hongling Zeng wrote:
> ti_pipe3_init() ignores the return value of ti_pipe3_enable_clocks(),
> which can lead to:
> 
> 1. Unclocked hardware access if clock enable fails
> 2. Unbalanced clock disables in error paths
> 
> ti_pipe3_enable_clocks() returns an error code when clock enable fails
> and rolls back any partially enabled clocks. If we ignore this error
> and continue, we access hardware without proper clocking, which can
> cause bus errors.
> 
> Additionally, if we reach error paths later in the function and call
> ti_pipe3_disable_clocks(), we'll be disabling already-disabled clocks,
> causing unbalanced disable warnings.
> 
> Fix this by checking the return value of ti_pipe3_enable_clocks()
> and returning early if it fails.
> 
> Fixes: 234738ea3390 ("phy: ti-pipe3: move clk initialization to a separate function")
> Reported-by: Sashiko AI <sashiko at kernel.org>
> Signed-off-by: Hongling Zeng <zenghongling at kylinos.cn>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam at oss.qualcomm.com>

One comment below.

> 
> ---
> Change in v5:
>   -Add Fix ignored clock enable return value in init patch
> ---
> Change in v6:
>   -Fix all clock leak paths comprehensively
>   -PCIe syscon update failure path
>   -SATA DPLL lock check path (also fix incorrect return logic)
>   -SATA errata path in ti_pipe3_exit()
> ---
>  drivers/phy/ti/phy-ti-pipe3.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/ti/phy-ti-pipe3.c b/drivers/phy/ti/phy-ti-pipe3.c
> index b5543b5c674c..b8c055893742 100644
> --- a/drivers/phy/ti/phy-ti-pipe3.c
> +++ b/drivers/phy/ti/phy-ti-pipe3.c
> @@ -500,7 +500,10 @@ static int ti_pipe3_init(struct phy *x)
>  	u32 val;
>  	int ret = 0;

Now this initialization becomes redundant.

- Mani

-- 
மணிவண்ணன் சதாசிவம்



More information about the linux-phy mailing list