diff options
author | Corey Minyard <cminyard@mvista.com> | 2012-03-28 17:42:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 20:14:36 -0400 |
commit | 7adf579c8babf62026e6aab1dee85e6b104d9936 (patch) | |
tree | 23b3c94b6f97ecee2b7f6eea3f10871d737506c2 /drivers/char/ipmi/ipmi_si_intf.c | |
parent | 828dc9da50f9632bbc5bc9dfa510619d13135015 (diff) |
ipmi: use a tasklet for handling received messages
The IPMI driver would release a lock, deliver a message, then relock.
This is obviously ugly, and this patch converts the message handler
interface to use a tasklet to schedule work. This lets the receive
handler be called from an interrupt handler with interrupts enabled.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/ipmi/ipmi_si_intf.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_si_intf.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c index 73ebbb1a326..01e53cd105d 100644 --- a/drivers/char/ipmi/ipmi_si_intf.c +++ b/drivers/char/ipmi/ipmi_si_intf.c | |||
@@ -320,16 +320,8 @@ static int register_xaction_notifier(struct notifier_block *nb) | |||
320 | static void deliver_recv_msg(struct smi_info *smi_info, | 320 | static void deliver_recv_msg(struct smi_info *smi_info, |
321 | struct ipmi_smi_msg *msg) | 321 | struct ipmi_smi_msg *msg) |
322 | { | 322 | { |
323 | /* Deliver the message to the upper layer with the lock | 323 | /* Deliver the message to the upper layer. */ |
324 | released. */ | 324 | ipmi_smi_msg_received(smi_info->intf, msg); |
325 | |||
326 | if (smi_info->run_to_completion) { | ||
327 | ipmi_smi_msg_received(smi_info->intf, msg); | ||
328 | } else { | ||
329 | spin_unlock(&(smi_info->si_lock)); | ||
330 | ipmi_smi_msg_received(smi_info->intf, msg); | ||
331 | spin_lock(&(smi_info->si_lock)); | ||
332 | } | ||
333 | } | 325 | } |
334 | 326 | ||
335 | static void return_hosed_msg(struct smi_info *smi_info, int cCode) | 327 | static void return_hosed_msg(struct smi_info *smi_info, int cCode) |
@@ -481,9 +473,7 @@ static void handle_flags(struct smi_info *smi_info) | |||
481 | 473 | ||
482 | start_clear_flags(smi_info); | 474 | start_clear_flags(smi_info); |
483 | smi_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT; | 475 | smi_info->msg_flags &= ~WDT_PRE_TIMEOUT_INT; |
484 | spin_unlock(&(smi_info->si_lock)); | ||
485 | ipmi_smi_watchdog_pretimeout(smi_info->intf); | 476 | ipmi_smi_watchdog_pretimeout(smi_info->intf); |
486 | spin_lock(&(smi_info->si_lock)); | ||
487 | } else if (smi_info->msg_flags & RECEIVE_MSG_AVAIL) { | 477 | } else if (smi_info->msg_flags & RECEIVE_MSG_AVAIL) { |
488 | /* Messages available. */ | 478 | /* Messages available. */ |
489 | smi_info->curr_msg = ipmi_alloc_smi_msg(); | 479 | smi_info->curr_msg = ipmi_alloc_smi_msg(); |