From: Cezary Rojewski <cezary.rojewski@intel.com>
To: WenTao Liang <vulab@iscas.ac.cn>
Cc: <pierre-louis.bossart@linux.dev>,
<amadeuszx.slawinski@linux.intel.com>, <songxiebing@kylinos.cn>,
<verhaegen@google.com>, <linux-sound@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>,
<liam.r.girdwood@linux.intel.com>,
<peter.ujfalusi@linux.intel.com>,
<yung-chuan.liao@linux.intel.com>, <kai.vehmanen@linux.intel.com>,
<broonie@kernel.org>, <perex@perex.cz>, <tiwai@suse.com>
Subject: Re: [PATCH] ASoC: Intel: avs: Fix d0ix reference count leak on set_params error path
Date: Thu, 18 Jun 2026 17:55:00 +0200 [thread overview]
Message-ID: <a2c08300-d999-4c76-b75b-db9548abfbe6@intel.com> (raw)
In-Reply-To: <20260612032256.23504-1-vulab@iscas.ac.cn>
On 6/12/2026 5:22 AM, WenTao Liang wrote:
> In avs_probe_compr_set_params(), avs_dsp_disable_d0ix() is called when
> no probe streams are active. This function atomically increments the
> d0ix_disable_depth counter before attempting the hardware power state
> transition. If the transition (avs_dsp_set_d0ix()) fails, the function
> returns an error but the counter remains elevated.
>
> The caller does not balance the counter on this error path, causing a
> reference count leak that permanently prevents the DSP from entering
> d0ix.
>
> Fix the leak by calling avs_dsp_enable_d0ix() to balance the previous
> disable call before returning the error, mirroring the existing cleanup
> pattern used when avs_dsp_init_probe() fails.
Hi,
When using AI assistance to generate a commit message the strict kernel
rules still apply. Please plainly answer _why_ the change is made, no
need to write a novel. The last last two paragraphs could be simply
dropped.
See Documentation/process for a number of helpful guides both for
writing doc manually and with assistance.
> Cc: stable@vger.kernel.org
> Fixes: 700462f55493 ("ASoC: Intel: avs: Probe compress operations")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
> ---
> sound/soc/intel/avs/probes.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/intel/avs/probes.c b/sound/soc/intel/avs/probes.c
> index 099119ad28b3..01d9421cf9ab 100644
> --- a/sound/soc/intel/avs/probes.c
> +++ b/sound/soc/intel/avs/probes.c
> @@ -162,8 +162,10 @@ static int avs_probe_compr_set_params(struct snd_compr_stream *cstream,
>
> /* D0ix not allowed during probing. */
> ret = avs_dsp_disable_d0ix(adev);
> - if (ret)
> + if (ret) {
> + avs_dsp_enable_d0ix(adev);
Things are not that simple with D0IX - D0-substates. In short, if
SET_D0IX IPC-message fails, the recommendation is to forgo the process
entirely, see comments in avs_dsp_set_d0ix() and avs_dsp_get_core().
Blind enable - no.
I could see avs_dsp_disable_d0ix() receiving an update that takes care
of lowering ->d0ix_disable_depth in case of non-IPC failure, if you're
willing to follow up.
> return ret;
> + }
>
> node_id.vindex = hdac_stream(host_stream)->stream_tag - 1;
> node_id.dma_type = AVS_DMA_HDA_HOST_INPUT;
prev parent reply other threads:[~2026-06-18 15:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 3:22 WenTao Liang
2026-06-18 15:55 ` Cezary Rojewski [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=a2c08300-d999-4c76-b75b-db9548abfbe6@intel.com \
--to=cezary.rojewski@intel.com \
--cc=amadeuszx.slawinski@linux.intel.com \
--cc=broonie@kernel.org \
--cc=kai.vehmanen@linux.intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=songxiebing@kylinos.cn \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=verhaegen@google.com \
--cc=vulab@iscas.ac.cn \
--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®