aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-05-26 17:43:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-27 12:12:50 -0400
commita747c5abc329611220f16df0bb4cf0ca4a7fdf0c (patch)
treef34b59f7208a7d320138ed0807474ee351534b4e /drivers/char
parent279fbd0c5daa60c76e59df33f436ca2300f2b603 (diff)
ipmi: handle run_to_completion properly in deliver_recv_msg()
If run_to_completion flag is set, it means that we are running in a single-threaded mode, and thus no locks are held. This fixes a deadlock when IPMI notifier is being called during panic. Signed-off-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Corey Minyard <minyard@acm.org> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index f052c481327a..35603dd4e6c5 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -323,9 +323,14 @@ static void deliver_recv_msg(struct smi_info *smi_info,
323{ 323{
324 /* Deliver the message to the upper layer with the lock 324 /* Deliver the message to the upper layer with the lock
325 released. */ 325 released. */
326 spin_unlock(&(smi_info->si_lock)); 326
327 ipmi_smi_msg_received(smi_info->intf, msg); 327 if (smi_info->run_to_completion) {
328 spin_lock(&(smi_info->si_lock)); 328 ipmi_smi_msg_received(smi_info->intf, msg);
329 } else {
330 spin_unlock(&(smi_info->si_lock));
331 ipmi_smi_msg_received(smi_info->intf, msg);
332 spin_lock(&(smi_info->si_lock));
333 }
329} 334}
330 335
331static void return_hosed_msg(struct smi_info *smi_info, int cCode) 336static void return_hosed_msg(struct smi_info *smi_info, int cCode)