diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-07-20 15:53:53 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-07-21 12:55:08 +0200 |
| commit | ac3335d7b4fde73f04fefecc280b20663706f600 (patch) | |
| tree | a12a156e93d23140912ba4f230f25781d21f91ca | |
| parent | b9dada6bb7eb0bdd1fd9b1f319fc524b48193f8e (diff) | |
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
| -rw-r--r-- | sound/drivers/dummy.c | 9 |
1 files changed, 9 insertions, 0 deletions
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, }; |
