From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 2/2] ASoC: img: img-spdif-out: Fix double clock disable on probe failure
Date: Tue, 27 Oct 2026 17:44:17 +0700 [thread overview]
Message-ID: <20261027104417.7150-3-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261027104417.7150-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
If registering the component or the PCM fails, the error path of
img_spdif_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_spdif_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@gmail.com>
---
sound/soc/img/img-spdif-out.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/img/img-spdif-out.c b/sound/soc/img/img-spdif-out.c
index 39a37e4830d8..d93b3a135d79 100644
--- a/sound/soc/img/img-spdif-out.c
+++ b/sound/soc/img/img-spdif-out.c
@@ -386,8 +386,12 @@ static int img_spdif_out_probe(struct platform_device *pdev)
return 0;
err_suspend:
+ pm_runtime_disable(&pdev->dev);
if (!pm_runtime_status_suspended(&pdev->dev))
img_spdif_out_runtime_suspend(&pdev->dev);
+
+ return ret;
+
err_pm_disable:
pm_runtime_disable(&pdev->dev);
--
2.43.0
prev parent reply other threads:[~2026-10-27 10:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-27 10:44 [PATCH 0/2] ASoC: img: " phucduc.bui
2026-10-27 10:44 ` [PATCH 1/2] ASoC: img: img-i2s-out: " phucduc.bui
2026-10-27 10:44 ` phucduc.bui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261027104417.7150-3-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®