Commit c49c0976 authored by Hidehiro Kawai's avatar Hidehiro Kawai Committed by Corey Minyard

ipmi: Don't call receive handler in the panic context

Received handlers defined as ipmi_recv_hndl member of struct
ipmi_user_hndl can take a spinlock.  This means that if the kernel
panics while holding the lock, a deadlock may happen on the lock
while flushing queued messages in the panic context.

Calling the receive handler doesn't make much meanings in the panic
context, simply skip it to avoid possible deadlocks.
Signed-off-by: default avatarHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent 06e5e345
...@@ -744,7 +744,13 @@ static void deliver_response(struct ipmi_recv_msg *msg) ...@@ -744,7 +744,13 @@ static void deliver_response(struct ipmi_recv_msg *msg)
ipmi_inc_stat(intf, unhandled_local_responses); ipmi_inc_stat(intf, unhandled_local_responses);
} }
ipmi_free_recv_msg(msg); ipmi_free_recv_msg(msg);
} else { } else if (!oops_in_progress) {
/*
* If we are running in the panic context, calling the
* receive handler doesn't much meaning and has a deadlock
* risk. At this moment, simply skip it in that case.
*/
ipmi_user_t user = msg->user; ipmi_user_t user = msg->user;
user->handler->ipmi_recv_hndl(msg, user->handler_data); user->handler->ipmi_recv_hndl(msg, user->handler_data);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment