Re: [PATCH v2 1/4] phy: freescale: fsl-samsung-hdmi: Fix runtime PM cleanup

From: Manivannan Sadhasivam

Date: Sat Sep 26 2026 - 10:27:12 EST


On Tue, Jul 21, 2026 at 02:47:49PM +0800, Can Peng wrote:
> fsl_samsung_hdmi_phy_probe() takes a runtime PM reference, marks the
> device active and enables runtime PM before registering the PHY clock.
> If phy_clk_register() fails, probe returns without dropping the runtime
> PM reference or disabling runtime PM.
>
> The remove callback only unregisters the clock provider, so runtime PM
> is also left enabled after a successful probe followed by driver unbind.
>
> Check pm_runtime_set_active(), use devm_pm_runtime_enable() so runtime
> PM is disabled automatically, and drop the initial noresume reference
> on PM setup and clock registration failures.
>
> Fixes: 6ad082bee902 ("phy: freescale: add Samsung HDMI PHY")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Can Peng <pengcan@xxxxxxxxxx>
> ---
> drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> index d010fec15671..e7af4f9c7b20 100644
> --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> @@ -665,20 +665,26 @@ static int fsl_samsung_hdmi_phy_probe(struct platform_device *pdev)
> "failed to get ref clk\n");
>
> pm_runtime_get_noresume(phy->dev);
> - pm_runtime_set_active(phy->dev);
> - pm_runtime_enable(phy->dev);
> + ret = pm_runtime_set_active(phy->dev);
> + if (ret)
> + goto pm_put_noidle;
> +
> + ret = devm_pm_runtime_enable(phy->dev);
> + if (ret)
> + goto pm_put_noidle;

Use devm_pm_runtime_set_active_enabled().

- Mani

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