[PATCH] ASoC: rockchip: i2s-tdm: Mark the device active before enabling runtime PM
Arun Iyengar via B4 Relay
devnull+aiyengar1990.gmail.com at kernel.org
Sun Nov 29 10:58:22 PST 2026
From: Arun Iyengar <aiyengar1990 at gmail.com>
Probe enables hclk and the mclks but leaves the runtime PM status
suspended. The probe error path then skips i2s_tdm_runtime_suspend()
and leaks the mclk enables, and the first runtime resume enables all
clocks a second time, so they never turn off.
Set the device active before pm_runtime_enable() and release the clocks
on error only through i2s_tdm_runtime_suspend(), after
pm_runtime_disable() has finished any suspend in flight.
Fixes: 081068fd6414 ("ASoC: rockchip: add support for i2s-tdm controller")
Signed-off-by: Arun Iyengar <aiyengar1990 at gmail.com>
---
Developed with Claude (Anthropic), which wrote the code and the commit
messages. I reviewed every change.
Found by the Sashiko review of the earlier i2s-tdm series.
Tested on 7.3 on an Orange Pi 5 (RK3588S): failslab on unbind/bind of
both I2S controllers. Probe failures in the PCM and component
registration run i2s_tdm_runtime_suspend() and every clock enable count
returns to its unbound value. Without the patch each rebind leaks the
probe's enables (mclk +2, hclk +1 on fddf0000).
---
sound/soc/rockchip/rockchip_i2s_tdm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/sound/soc/rockchip/rockchip_i2s_tdm.c b/sound/soc/rockchip/rockchip_i2s_tdm.c
index 023d603d27e7..a1c1ad84945e 100644
--- a/sound/soc/rockchip/rockchip_i2s_tdm.c
+++ b/sound/soc/rockchip/rockchip_i2s_tdm.c
@@ -1407,6 +1407,7 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
goto err_disable_hclk;
}
+ pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
regmap_update_bits(i2s_tdm->regmap, I2S_DMACR, I2S_DMACR_TDL_MASK,
@@ -1437,9 +1438,10 @@ static int rockchip_i2s_tdm_probe(struct platform_device *pdev)
return 0;
err_suspend:
+ pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
i2s_tdm_runtime_suspend(&pdev->dev);
- pm_runtime_disable(&pdev->dev);
+ return ret;
err_disable_hclk:
clk_disable_unprepare(i2s_tdm->hclk);
---
base-commit: 626d2233d48884f22c16011a6e44f905824bd8e0
change-id: 20261129-i2s-tdm-rpm-78293f774116
Best regards,
--
Arun Iyengar <aiyengar1990 at gmail.com>
More information about the Linux-rockchip
mailing list