Commit 2999ff5ba12a3dce5a86acd7078fd8787623ec63

Authored by Takashi Iwai
Committed by Jaroslav Kysela
1 parent f40b68903c

[ALSA] Fix a deadlock in snd-rtctimer

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>

Showing 1 changed file with 3 additions and 2 deletions Side-by-side Diff

... ... @@ -628,8 +628,9 @@
628 628 struct snd_timer_instance *ti;
629 629 struct list_head *p;
630 630 unsigned long resolution, ticks;
  631 + unsigned long flags;
631 632  
632   - spin_lock(&timer->lock);
  633 + spin_lock_irqsave(&timer->lock, flags);
633 634 /* now process all callbacks */
634 635 while (!list_empty(&timer->sack_list_head)) {
635 636 p = timer->sack_list_head.next; /* get first item */
... ... @@ -649,7 +650,7 @@
649 650 spin_lock(&timer->lock);
650 651 ti->flags &= ~SNDRV_TIMER_IFLG_CALLBACK;
651 652 }
652   - spin_unlock(&timer->lock);
  653 + spin_unlock_irqrestore(&timer->lock, flags);
653 654 }
654 655  
655 656 /*