From: Vinod Koul <vkoul@kernel.org>
To: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Cc: perex@perex.cz, tiwai@suse.com, pierre-louis.bossart@linux.dev,
linux-sound@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 4/4] ALSA: compress: reject restarting an ACTIVE task via origin_seqno
Date: Wed, 7 Oct 2026 16:14:47 +0200 [thread overview]
Message-ID: <asZT1yC4b5ipkG9N@parshuram> (raw)
In-Reply-To: <20261007132509.18237-5-peter.ujfalusi@linux.intel.com>
On 07-10-26, 16:25, Peter Ujfalusi wrote:
> snd_compr_task_start_prepare() only rejects tasks with
> state >= SND_COMPRESS_TASK_STATE_FINISHED. Since the enum is
> IDLE(0) < ACTIVE(1) < FINISHED(2), this accepts ACTIVE tasks and
> rejects FINISHED ones, the opposite of what the origin_seqno
> mechanism needs: origin_seqno is meant to let a caller reuse a
> FINISHED task's buffers for a new job, not to restart a task that is
> still queued with the driver.
>
> The seqno lookup path in snd_compr_task_start() has its own explicit
> "task->state != IDLE" guard, but the origin_seqno lookup path relies
> solely on this function, so it can restart an ACTIVE task, causing
> ops->task_start() to be called twice for the same task and
> runtime->active_tasks to be incremented twice without a matching
> finish/stop.
>
> Accept IDLE and FINISHED, reject ACTIVE, on both entry paths.
Acked-by: Vinod Koul <vkoul@kernel.org>
--
~Vinod
prev parent reply other threads:[~2026-10-07 14:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 13:25 [PATCH 0/4] ALSA: compress: fix buffer handling and state validation Peter Ujfalusi
2026-10-07 13:25 ` [PATCH 1/4] ALSA: compress: fix buffer leak on repeated SET_PARAMS Peter Ujfalusi
2026-10-07 14:04 ` Takashi Iwai
2026-10-07 14:10 ` Vinod Koul
2026-10-07 14:25 ` Péter Ujfalusi
2026-10-07 14:37 ` Vinod Koul
2026-10-08 6:25 ` Péter Ujfalusi
2026-10-08 7:57 ` Péter Ujfalusi
2026-10-08 7:54 ` Péter Ujfalusi
2026-10-07 14:08 ` Vinod Koul
2026-10-07 13:25 ` [PATCH 2/4] ALSA: compress: reject buffer geometry change on gapless next_track Peter Ujfalusi
2026-10-07 14:12 ` Vinod Koul
2026-10-07 13:25 ` [PATCH 3/4] ALSA: compress: add missing OPEN-state gate to SET_METADATA Peter Ujfalusi
2026-10-07 14:12 ` Vinod Koul
2026-10-07 13:25 ` [PATCH 4/4] ALSA: compress: reject restarting an ACTIVE task via origin_seqno Peter Ujfalusi
2026-10-07 14:14 ` Vinod Koul [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=asZT1yC4b5ipkG9N@parshuram \
--to=vkoul@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=stable@vger.kernel.org \
--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