diff options
author | Corey Minyard <cminyard@mvista.com> | 2016-01-06 16:32:06 +0100 |
---|---|---|
committer | Corey Minyard <cminyard@mvista.com> | 2016-03-18 13:01:23 +0100 |
commit | 21c8f9154d9b3d2d84b619c2afdb6965f9d57975 (patch) | |
tree | deab024c41de970b95229f5d552a2c456076fffb | |
parent | Merge tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/... (diff) | |
download | linux-21c8f9154d9b3d2d84b619c2afdb6965f9d57975.tar.xz linux-21c8f9154d9b3d2d84b619c2afdb6965f9d57975.zip |
ipmi_ssif: Fix logic around alert handling
There was a mistake in the logic, if an alert came in very quickly
it would hang the driver.
Signed-off-by: Corey Minyard <cminyard@mvista.com>
-rw-r--r-- | drivers/char/ipmi/ipmi_ssif.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c index 5f1c3d08ba65..8b3be8b92573 100644 --- a/drivers/char/ipmi/ipmi_ssif.c +++ b/drivers/char/ipmi/ipmi_ssif.c @@ -920,23 +920,18 @@ static void msg_written_handler(struct ssif_info *ssif_info, int result, msg_done_handler(ssif_info, -EIO, NULL, 0); } } else { + /* Ready to request the result. */ unsigned long oflags, *flags; - bool got_alert; ssif_inc_stat(ssif_info, sent_messages); ssif_inc_stat(ssif_info, sent_messages_parts); flags = ipmi_ssif_lock_cond(ssif_info, &oflags); - got_alert = ssif_info->got_alert; - if (got_alert) { + if (ssif_info->got_alert) { + /* The result is already ready, just start it. */ ssif_info->got_alert = false; - ssif_info->waiting_alert = false; - } - - if (got_alert) { ipmi_ssif_unlock_cond(ssif_info, flags); - /* The alert already happened, try now. */ - retry_timeout((unsigned long) ssif_info); + start_get(ssif_info); } else { /* Wait a jiffie then request the next message */ ssif_info->waiting_alert = true; |