]> Git Repo - J-linux.git/commitdiff
ALSA: pcm: fix lost wakeup event scenarios in snd_pcm_drain
authorYuki Tsunashima <[email protected]>
Mon, 29 Jul 2019 15:10:36 +0000 (17:10 +0200)
committerTakashi Iwai <[email protected]>
Mon, 29 Jul 2019 17:05:42 +0000 (19:05 +0200)
lost wakeup can occur after enabling irq, therefore put task
into interruptible before enabling interrupts,

without this change, task can be put to sleep and snd_pcm_drain
will delay

Fixes: f2b3614cefb6 ("ALSA: PCM - Don't check DMA time-out too shortly")
Signed-off-by: Yuki Tsunashima <[email protected]>
Signed-off-by: Suresh Udipi <[email protected]>
[ported from 4.9]
Signed-off-by: Adam Miartus <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
sound/core/pcm_native.c

index 12dd9b318db18adcc087c64ae5a4db7e9661d30f..703857aab00fc17e6ca667fdcaf27e94200bc84f 100644 (file)
@@ -1873,6 +1873,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
                if (!to_check)
                        break; /* all drained */
                init_waitqueue_entry(&wait, current);
+               set_current_state(TASK_INTERRUPTIBLE);
                add_wait_queue(&to_check->sleep, &wait);
                snd_pcm_stream_unlock_irq(substream);
                if (runtime->no_period_wakeup)
@@ -1885,7 +1886,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
                        }
                        tout = msecs_to_jiffies(tout * 1000);
                }
-               tout = schedule_timeout_interruptible(tout);
+               tout = schedule_timeout(tout);
 
                snd_pcm_stream_lock_irq(substream);
                group = snd_pcm_stream_group_ref(substream);
This page took 0.056868 seconds and 4 git commands to generate.