Commit 9d6c9b17 authored by Takashi Iwai's avatar Takashi Iwai Committed by Adrian Bunk

ALSA: Fix a deadlock in snd-rtctimer

Fix an occasional deadlock occuring with snd-rtctimer driver,
added irqsave to the lock in tasklet (ALSA bug#952).
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent ac0f6b9e
...@@ -627,8 +627,9 @@ static void snd_timer_tasklet(unsigned long arg) ...@@ -627,8 +627,9 @@ static void snd_timer_tasklet(unsigned long arg)
struct snd_timer_instance *ti; struct snd_timer_instance *ti;
struct list_head *p; struct list_head *p;
unsigned long resolution, ticks; unsigned long resolution, ticks;
unsigned long flags;
spin_lock(&timer->lock); spin_lock_irqsave(&timer->lock, flags);
/* now process all callbacks */ /* now process all callbacks */
while (!list_empty(&timer->sack_list_head)) { while (!list_empty(&timer->sack_list_head)) {
p = timer->sack_list_head.next; /* get first item */ p = timer->sack_list_head.next; /* get first item */
...@@ -648,7 +649,7 @@ static void snd_timer_tasklet(unsigned long arg) ...@@ -648,7 +649,7 @@ static void snd_timer_tasklet(unsigned long arg)
spin_lock(&timer->lock); spin_lock(&timer->lock);
ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK; ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
} }
spin_unlock(&timer->lock); spin_unlock_irqrestore(&timer->lock, flags);
} }
/* /*
......
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