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>
This commit is contained in:
parent
279fbd0c5d
commit
a747c5abc3
1 changed files with 8 additions and 3 deletions
|
@ -323,9 +323,14 @@ static void deliver_recv_msg(struct smi_info *smi_info,
|
||||||
{
|
{
|
||||||
/* Deliver the message to the upper layer with the lock
|
/* Deliver the message to the upper layer with the lock
|
||||||
released. */
|
released. */
|
||||||
spin_unlock(&(smi_info->si_lock));
|
|
||||||
ipmi_smi_msg_received(smi_info->intf, msg);
|
if (smi_info->run_to_completion) {
|
||||||
spin_lock(&(smi_info->si_lock));
|
ipmi_smi_msg_received(smi_info->intf, msg);
|
||||||
|
} else {
|
||||||
|
spin_unlock(&(smi_info->si_lock));
|
||||||
|
ipmi_smi_msg_received(smi_info->intf, msg);
|
||||||
|
spin_lock(&(smi_info->si_lock));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void return_hosed_msg(struct smi_info *smi_info, int cCode)
|
static void return_hosed_msg(struct smi_info *smi_info, int cCode)
|
||||||
|
|
Loading…
Add table
Reference in a new issue