Skip to content

Commit

Permalink
[ALSA] Fix a deadlock in snd-rtctimer
Browse files Browse the repository at this point in the history
Fix a 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>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jul 12, 2006
1 parent f40b689 commit 2999ff5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sound/core/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
}

/*
Expand Down

0 comments on commit 2999ff5

Please sign in to comment.