Re: [PATCH v6 3/9] phy: rockchip-samsung-dcphy: Unwind power-on on PLL lock failure

From: Michael Riesch

Date: Wed Nov 11 2026 - 08:13:12 EST


Hi Jason,

On 11/10/26 09:18, Jason Yang wrote:
> samsung_mipi_dphy_power_on() returns on a PLL lock timeout with PLL_EN
> set and m_phy_rst still asserted, and the PHY core does not call
> power_off after a failed power_on.
>
> Today the APB reset at the start of the next power_on cleans this up.
>
> A later change moves that reset to runtime resume, so the leftover
> PLL_EN would stay set, and regmap_update_bits() would not even write
> it again.
>
> Unwind the power-on before returning the error.
>
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/linux-phy/sashiko-outbox-174059@xxxxxxxxxx/
> Signed-off-by: Jason Yang <jason98166@xxxxxxxxx>
> ---
> drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
> index 7382043e1f31..ce1bc62497c5 100644
> --- a/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
> +++ b/drivers/phy/rockchip/phy-rockchip-samsung-dcphy.c
> @@ -1343,8 +1343,11 @@ static int samsung_mipi_dphy_power_on(struct samsung_mipi_dcphy *samsung)
> samsung_mipi_dphy_clk_lane_timing_init(samsung);
> samsung_mipi_dphy_data_lane_timing_init(samsung);
> ret = samsung_mipi_dcphy_pll_enable(samsung);

I wonder whether this should be here in the first place. Only judging by
the name, samsung_mipi_dcphy_pll_enable is something that affects the
complete logic block and probably should be kept in runtime resume to
begin with.

However, since _dphy_rx_power_on does not call this funcion, it seems to
be something related only to the TX side of the logic block, but for
D-PHY and C-PHY. In this case, it probably should go into
samsung_mipi_dcphy_tx_power_on.

On the off chance that this is actually for the D-PHY TX operation, the
function should be renamed "*_dcphy_pll_*" -> "*_dphy_pll_*" or
"*_dphy_tx_pll_*".

What do you think?

Best regards,
Michael


> - if (ret < 0)
> + if (ret < 0) {
> + samsung_mipi_dcphy_pll_disable(samsung);
> + reset_control_deassert(samsung->m_phy_rst);
> return ret;
> + }
>
> samsung_mipi_dphy_lane_enable(samsung);
>
>