Commit f74f98be authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

ALSA Core
- fixed oops at resume.
- block also the non-blocking devices until the resume is finished.
parent 3b43c523
......@@ -682,6 +682,7 @@ int snd_card_file_remove(snd_card_t *card, struct file *file)
int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file)
{
wait_queue_t wait;
int result = 0;
/* fastpath */
if (snd_power_get_state(card) == power_state)
......@@ -689,18 +690,24 @@ int snd_power_wait(snd_card_t *card, unsigned int power_state, struct file *file
init_waitqueue_entry(&wait, current);
add_wait_queue(&card->power_sleep, &wait);
while (1) {
if (card->shutdown)
return -ENODEV;
if (snd_power_get_state(card) == power_state) {
remove_wait_queue(&card->power_sleep, &wait);
return 0;
if (card->shutdown) {
result = -ENODEV;
break;
}
if (file && (file->f_flags & O_NONBLOCK))
return -EAGAIN;
if (snd_power_get_state(card) == power_state)
break;
#if 0 /* block all devices */
if (file && (file->f_flags & O_NONBLOCK)) {
result = -EAGAIN;
break;
}
#endif
set_current_state(TASK_UNINTERRUPTIBLE);
snd_power_unlock(card);
schedule_timeout(30 * HZ);
snd_power_lock(card);
}
remove_wait_queue(&card->power_sleep, &wait);
return result;
}
#endif /* CONFIG_PM */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment