mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
ALSA: pcm: fix lost wakeup event scenarios in snd_pcm_drain
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: f2b3614cef
("ALSA: PCM - Don't check DMA time-out too shortly")
Signed-off-by: Yuki Tsunashima <ytsunashima@jp.adit-jv.com>
Signed-off-by: Suresh Udipi <sudipi@jp.adit-jv.com>
[ported from 4.9]
Signed-off-by: Adam Miartus <amiartus@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
74bf71ed79
commit
37151a41df
1 changed files with 2 additions and 1 deletions
|
@ -1873,6 +1873,7 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
|
||||||
if (!to_check)
|
if (!to_check)
|
||||||
break; /* all drained */
|
break; /* all drained */
|
||||||
init_waitqueue_entry(&wait, current);
|
init_waitqueue_entry(&wait, current);
|
||||||
|
set_current_state(TASK_INTERRUPTIBLE);
|
||||||
add_wait_queue(&to_check->sleep, &wait);
|
add_wait_queue(&to_check->sleep, &wait);
|
||||||
snd_pcm_stream_unlock_irq(substream);
|
snd_pcm_stream_unlock_irq(substream);
|
||||||
if (runtime->no_period_wakeup)
|
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 = msecs_to_jiffies(tout * 1000);
|
||||||
}
|
}
|
||||||
tout = schedule_timeout_interruptible(tout);
|
tout = schedule_timeout(tout);
|
||||||
|
|
||||||
snd_pcm_stream_lock_irq(substream);
|
snd_pcm_stream_lock_irq(substream);
|
||||||
group = snd_pcm_stream_group_ref(substream);
|
group = snd_pcm_stream_group_ref(substream);
|
||||||
|
|
Loading…
Add table
Reference in a new issue