]> git.hungrycats.org Git - linux/commitdiff
ALSA: Fix a deadlock in snd-rtctimer
authorTakashi Iwai <tiwai@suse.de>
Thu, 13 Jul 2006 18:08:01 +0000 (20:08 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 25 Jul 2006 03:35:26 +0000 (20:35 -0700)
Fix an occasional deadlock occuring with snd-rtctimer driver,
added irqsave to the lock in tasklet (ALSA bug#952).

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/core/timer.c

index cdeeb639b675a3e35a532b68a90443fced7e49f7..4585600ba0be6a9ad7b3d5b9064a2f8a41014dc5 100644 (file)
@@ -628,8 +628,9 @@ static void snd_timer_tasklet(unsigned long arg)
        struct snd_timer_instance *ti;
        struct list_head *p;
        unsigned long resolution, ticks;
+       unsigned long flags;
 
-       spin_lock(&timer->lock);
+       spin_lock_irqsave(&timer->lock, flags);
        /* now process all callbacks */
        while (!list_empty(&timer->sack_list_head)) {
                p = timer->sack_list_head.next;         /* get first item */
@@ -649,7 +650,7 @@ static void snd_timer_tasklet(unsigned long arg)
                spin_lock(&timer->lock);
                ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
        }
-       spin_unlock(&timer->lock);
+       spin_unlock_irqrestore(&timer->lock, flags);
 }
 
 /*