ipmi_ssif: Fix logic around alert handling
authorCorey Minyard <cminyard@mvista.com>
Wed, 6 Jan 2016 15:32:06 +0000 (09:32 -0600)
committerCorey Minyard <cminyard@mvista.com>
Fri, 18 Mar 2016 12:01:23 +0000 (07:01 -0500)
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>
drivers/char/ipmi/ipmi_ssif.c

index 5f1c3d08ba6540e4afc9469f888e442862d09fa3..8b3be8b9257398b7f0dd306158a6428ea0949ad9 100644 (file)
@@ -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;