[PATCH 2/3] ALSA: dummy: Implement sync_stop for systimer, too

From: Takashi Iwai

Date: Mon Jul 20 2026 - 09:59:23 EST


The systimer backend invokes timer_delete() at stopping the PCM, but
it misses its synchronization, which might lead to concurrent changes
or releases at PCM prepare or free. Use the sync_stop callback to
assure the synchronization of timer deletion.

Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
sound/drivers/dummy.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c
index ddd4da058693..3bc0289e3518 100644
--- a/sound/drivers/dummy.c
+++ b/sound/drivers/dummy.c
@@ -286,6 +286,14 @@ static int dummy_systimer_stop(struct snd_pcm_substream *substream)
return 0;
}

+static int dummy_systimer_sync_stop(struct snd_pcm_substream *substream)
+{
+ struct dummy_systimer_pcm *dpcm = substream->runtime->private_data;
+
+ timer_delete_sync(&dpcm->timer);
+ return 0;
+}
+
static int dummy_systimer_prepare(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
@@ -351,6 +359,7 @@ static const struct dummy_timer_ops dummy_systimer_ops = {
.prepare = dummy_systimer_prepare,
.start = dummy_systimer_start,
.stop = dummy_systimer_stop,
+ .sync_stop = dummy_systimer_sync_stop,
.pointer = dummy_systimer_pointer,
};

--
2.55.0