diff options
author | Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com> | 2015-07-27 14:55:16 +0900 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2015-09-03 15:02:28 -0500 |
commit | 82802f968bd3118af04eaeb3814c21d9813be527 (patch) | |
tree | dd26a8d2a0d96b013938814083144654bf30db71 /drivers/char/ipmi/ipmi_msghandler.c | |
parent | e45361d733d0a1432b0f6307375045e66ac02489 (diff) | |
download | linux-82802f968bd3118af04eaeb3814c21d9813be527.tar.gz linux-82802f968bd3118af04eaeb3814c21d9813be527.tar.bz2 linux-82802f968bd3118af04eaeb3814c21d9813be527.zip |
ipmi: Don't flush messages in sender() in run-to-completion mode
When flushing queued messages in run-to-completion mode,
smi_event_handler() is recursively called.
flush_messages()
smi_event_handler()
handle_transaction_done()
deliver_recv_msg()
ipmi_smi_msg_received()
smi_recv_tasklet()
sender()
flush_messages()
smi_event_handler()
...
The depth of the recursive call depends on the number of queued
messages, so it can cause a stack overflow if many messages have
been queued.
To solve this problem, this patch removes flush_messages()
from sender()@ipmi_si_intf.c. Instead, add flush_messages() to
caller side of sender() if needed. Additionally, to implement this,
add new handler flush_messages to struct ipmi_smi_handlers.
Signed-off-by: Hidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
Fixed up a comment and some spacing issues.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Diffstat (limited to 'drivers/char/ipmi/ipmi_msghandler.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_msghandler.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_msghandler.c b/drivers/char/ipmi/ipmi_msghandler.c index 5e31c339062e..6e191ff910e6 100644 --- a/drivers/char/ipmi/ipmi_msghandler.c +++ b/drivers/char/ipmi/ipmi_msghandler.c @@ -4295,6 +4295,9 @@ static void ipmi_panic_request_and_wait(ipmi_smi_t intf, 0, 1); /* Don't retry, and don't wait. */ if (rv) atomic_sub(2, &panic_done_count); + else if (intf->handlers->flush_messages) + intf->handlers->flush_messages(intf->send_info); + while (atomic_read(&panic_done_count) != 0) ipmi_poll(intf); } |