tree 97309901620848a9bc045dd88df6cc7eb2582ab0
parent 75b0768a396f2a25901b7b1edc87b95cdb3af4ef
author Corey Minyard <[EMAIL PROTECTED]> Wed, 07 Sep 2005 05:18:39 -0700
committer Linus Torvalds <[EMAIL PROTECTED]> Thu, 08 Sep 2005 06:57:48 -0700

[PATCH] ipmi: watchdog/NMI interaction fixes

There are some interactions between IPMI NMI timeouts and the other operations
of the IPMI driver.  This make sure those interactions are handled properly.

Signed-off-by: Corey Minyard <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>

 drivers/char/ipmi/ipmi_watchdog.c |   18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/char/ipmi/ipmi_watchdog.c 
b/drivers/char/ipmi/ipmi_watchdog.c
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -259,7 +259,7 @@ static int i_ipmi_set_timeout(struct ipm
 
        data[1] = 0;
        WDOG_SET_TIMEOUT_ACT(data[1], ipmi_watchdog_state);
-       if (pretimeout > 0) {
+       if ((pretimeout > 0) && (ipmi_watchdog_state != WDOG_TIMEOUT_NONE)) {
            WDOG_SET_PRETIMEOUT_ACT(data[1], preaction_val);
            data[2] = pretimeout;
        } else {
@@ -817,15 +817,19 @@ static void ipmi_register_watchdog(int i
 static int
 ipmi_nmi(void *dev_id, struct pt_regs *regs, int cpu, int handled)
 {
+        /* If we are not expecting a timeout, ignore it. */
+       if (ipmi_watchdog_state == WDOG_TIMEOUT_NONE)
+               return NOTIFY_DONE;
+
        /* If no one else handled the NMI, we assume it was the IPMI
            watchdog. */
-       if ((!handled) && (preop_val == WDOG_PREOP_PANIC))
+       if ((!handled) && (preop_val == WDOG_PREOP_PANIC)) {
+               /* On some machines, the heartbeat will give
+                  an error and not work unless we re-enable
+                  the timer.   So do so. */
+               pretimeout_since_last_heartbeat = 1;
                panic(PFX "pre-timeout");
-
-       /* On some machines, the heartbeat will give
-          an error and not work unless we re-enable
-          the timer.   So do so. */
-       pretimeout_since_last_heartbeat = 1;
+       }
 
        return NOTIFY_DONE;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to