https://github.com/torvalds/linux
Revision c6482dde1c2811afba289b2344268f850595f350 authored by Arjan van de Ven on 04 July 2006, 10:07:22 UTC, committed by Linus Torvalds on 04 July 2006, 17:24:57 UTC
There is a code sequence where the locking is substream->self_group.lock
-> ins->scbs[index].lock

substream->self_group.lock is interrupt safe, and taken from irq context
as well (trace is snipped for brevity)

so what can happen is

   cpu 0                   	cpu 1
   user context			user context

				take ins->scbs[index].lock without disabling interrupts

   get substream->self_group.lock (irqsafe)
   try to get ins->scbs[index].lock (spins)

				interrupt happens
				try to get substream->self_group.lock (spins)

which is an obvious AB-BA deadlock

fix is to just take the lock with _irqsafe

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Jaroslav Kysela <perex@suse.cz>
Acked-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1 parent a46f948
History
Tip revision: c6482dde1c2811afba289b2344268f850595f350 authored by Arjan van de Ven on 04 July 2006, 10:07:22 UTC
[PATCH] fix AB-BA deadlock inversion at cs46xx_dsp_remove_scb
Tip revision: c6482dd
File Mode Size
oss
seq
Kconfig -rw-r--r-- 5.0 KB
Makefile -rw-r--r-- 870 bytes
control.c -rw-r--r-- 36.2 KB
control_compat.c -rw-r--r-- 11.2 KB
device.c -rw-r--r-- 7.0 KB
hwdep.c -rw-r--r-- 13.2 KB
hwdep_compat.c -rw-r--r-- 2.3 KB
info.c -rw-r--r-- 23.1 KB
info_oss.c -rw-r--r-- 4.0 KB
init.c -rw-r--r-- 20.0 KB
isadma.c -rw-r--r-- 2.8 KB
memalloc.c -rw-r--r-- 16.7 KB
memory.c -rw-r--r-- 2.5 KB
misc.c -rw-r--r-- 2.1 KB
pcm.c -rw-r--r-- 31.4 KB
pcm_compat.c -rw-r--r-- 15.0 KB
pcm_lib.c -rw-r--r-- 57.1 KB
pcm_memory.c -rw-r--r-- 11.4 KB
pcm_misc.c -rw-r--r-- 12.6 KB
pcm_native.c -rw-r--r-- 93.0 KB
pcm_timer.c -rw-r--r-- 4.1 KB
rawmidi.c -rw-r--r-- 48.6 KB
rawmidi_compat.c -rw-r--r-- 3.5 KB
rtctimer.c -rw-r--r-- 4.0 KB
sgbuf.c -rw-r--r-- 3.1 KB
sound.c -rw-r--r-- 10.6 KB
sound_oss.c -rw-r--r-- 7.3 KB
timer.c -rw-r--r-- 51.5 KB
timer_compat.c -rw-r--r-- 3.5 KB

back to top