ALSA: dummy: Implement sync_stop for systimer, too

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@suse.de>
Link: https://patch.msgid.link/20260720135356.1779857-3-tiwai@suse.de
This commit is contained in:
Takashi Iwai 2026-07-20 15:53:53 +02:00
parent b9dada6bb7
commit ac3335d7b4

View File

@ -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,
};