[PATCH 1/2] ASoC: img: img-i2s-out: Fix double clock disable on probe failure
From: phucduc . bui
Date: Tue Oct 27 2026 - 06:48:56 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
If registering the component or the PCM fails, the error path of
img_i2s_out_probe() checks the runtime PM status and suspends the device
by hand before calling pm_runtime_disable(). By then, the asynchronous
suspend request queued by pm_runtime_put() may still be pending or
running, so the suspend callback can run twice and disable the ref and
sys clocks twice.
Disable runtime PM first, as img_i2s_out_dev_remove() does. This cancels
the suspend request queued by pm_runtime_put() if it is still pending,
or waits for it to finish if it is already running, so the status is
stable when checked and the suspend callback runs only once.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/img/img-i2s-out.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/img/img-i2s-out.c b/sound/soc/img/img-i2s-out.c
index caa7870dbec6..2aa8182d561d 100644
--- a/sound/soc/img/img-i2s-out.c
+++ b/sound/soc/img/img-i2s-out.c
@@ -535,8 +535,12 @@ static int img_i2s_out_probe(struct platform_device *pdev)
return 0;
err_suspend:
+ pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
img_i2s_out_runtime_suspend(&pdev->dev);
+
+ return ret;
+
err_pm_disable:
pm_runtime_disable(&pdev->dev);
--
2.43.0