* driver spin lock and files_lock deadlock question
@ 2007-12-21 6:59 Srinivas Kommu
2007-12-21 7:17 ` Al Viro
0 siblings, 1 reply; 2+ messages in thread
From: Srinivas Kommu @ 2007-12-21 6:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Srinivas Kommu
I have a driver that needs to be SMP-safe. It also has some code hooking
into the net_rx_action softirq. So it takes a spinlock and disables the
local bottom-half around its critical sections:
spin_lock_bh(&driver_lock). Now, I'm facing a deadlock under a
particular sequence involving the files_lock:
1. CPU 0 takes driver_lock and then calls remove_proc_entry() which is
hanging at spin_lock(&files_lock).
2. CPU 1 was in fput() which took files_lock; the softirq comes in at
this point and attempts to take driver_lock and hangs forever.
It seems this kind of a deadlock can happen with any kernel lock, not
just files_lock. What's the driver's mistake here? Is it wrong to call
remove_proc_entry() while holding another lock? What is the right thing
to do?
This is with the 2.4 kernel, BTW.
thanks
srini
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-12-21 7:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 6:59 driver spin lock and files_lock deadlock question Srinivas Kommu
2007-12-21 7:17 ` Al Viro
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.