[patch 41/45] ALSA: Fix a deadlock in snd-rtctimer

From: Greg KH
Date: Mon Jul 17 2006 - 12:34:02 EST


-stable review patch. If anyone has any objections, please let us know.

------------------
From: Takashi Iwai <tiwai@xxxxxxx>

[PATCH] 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: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Jaroslav Kysela <perex@xxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
sound/core/timer.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

--- linux-2.6.17.6.orig/sound/core/timer.c
+++ linux-2.6.17.6/sound/core/timer.c
@@ -628,8 +628,9 @@ static void snd_timer_tasklet(unsigned l
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 l
spin_lock(&timer->lock);
ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
}
- spin_unlock(&timer->lock);
+ spin_unlock_irqrestore(&timer->lock, flags);
}

/*

--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/