From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Cc: Mark Brown <broonie@kernel.org>,
Bard Liao <yung-chuan.liao@linux.intel.com>,
Jaroslav Kysela <perex@perex.cz>,
Liam Girdwood <lgirdwood@gmail.com>,
Maciej Strozek <mstrozek@opensource.cirrus.com>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.dev>,
Takashi Iwai <tiwai@suse.com>,
patches@opensource.cirrus.com, linux-sound@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 2/4] ASoC: SDCA: enable pm_runtime before taking the initial reference
Date: Mon, 19 Oct 2026 09:39:30 +0100 [thread overview]
Message-ID: <atXXQv+d+AGd2VIO@opensource.cirrus.com> (raw)
In-Reply-To: <20261018192359.287987-3-srinivas.kandagatla@oss.qualcomm.com>
On Sun, Oct 18, 2026 at 08:23:57PM +0100, Srinivas Kandagatla wrote:
> If devm_pm_runtime_enable() failed, the usage count taken earlier by
> pm_runtime_get_noresume() was never dropped. Reorder so the get only
> happens once enable has succeeded.
>
> Fixes: 2d877d0659cb ("ASoC: SDCA: Add basic SDCA class driver")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
> ---
> sound/soc/sdca/sdca_class.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sdca/sdca_class.c b/sound/soc/sdca/sdca_class.c
> index bcc660aeb739..3361db188046 100644
> --- a/sound/soc/sdca/sdca_class.c
> +++ b/sound/soc/sdca/sdca_class.c
> @@ -194,12 +194,13 @@ int sdca_class_probe(struct sdw_slave *sdw,
> pm_runtime_set_autosuspend_delay(dev, 250);
> pm_runtime_use_autosuspend(dev);
> pm_runtime_set_active(dev);
> - pm_runtime_get_noresume(dev);
>
> ret = devm_pm_runtime_enable(dev);
> if (ret)
> return ret;
>
> + pm_runtime_get_noresume(dev);
I think it would be better to drop the reference on the error
path. Doing it this way round there is a very small chance that
the device auto-suspends between the enable and get_noresume.
The intention was to keep everything powered on until bring up
was complete.
Thanks,
Charles
next prev parent reply other threads:[~2026-10-19 8:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-18 19:23 [PATCH 0/4] ASoC: SDCA: class-driver fixes and PDM data-port support Srinivas Kandagatla
2026-10-18 19:23 ` [PATCH 1/4] ASoC: SDCA: propagate sdw_slave_read_prop() failure in class_read_prop Srinivas Kandagatla
2026-10-19 8:37 ` Charles Keepax
2026-10-18 19:23 ` [PATCH 2/4] ASoC: SDCA: enable pm_runtime before taking the initial reference Srinivas Kandagatla
2026-10-19 8:39 ` Charles Keepax [this message]
2026-10-18 19:23 ` [PATCH 3/4] ASoC: SDCA: re-enable IRQ on pm_runtime_force_suspend failure Srinivas Kandagatla
2026-10-19 8:40 ` Charles Keepax
2026-10-18 19:23 ` [PATCH 4/4] ASoC: SDCA: class_function: clear sconfig.bps on PDM data-port terminals Srinivas Kandagatla
2026-10-19 9:02 ` Charles Keepax
2026-10-19 16:19 ` Pierre-Louis Bossart
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=atXXQv+d+AGd2VIO@opensource.cirrus.com \
--to=ckeepax@opensource.cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mstrozek@opensource.cirrus.com \
--cc=patches@opensource.cirrus.com \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.dev \
--cc=srinivas.kandagatla@oss.qualcomm.com \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=yung-chuan.liao@linux.intel.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®