diff options
-rw-r--r-- | 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 index d35a953961cb..82d564342084 100644 --- 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 ipmi_smi_msg *smi_msg, | |||
259 | 259 | ||
260 | data[1] = 0; | 260 | data[1] = 0; |
261 | WDOG_SET_TIMEOUT_ACT(data[1], ipmi_watchdog_state); | 261 | WDOG_SET_TIMEOUT_ACT(data[1], ipmi_watchdog_state); |
262 | if (pretimeout > 0) { | 262 | if ((pretimeout > 0) && (ipmi_watchdog_state != WDOG_TIMEOUT_NONE)) { |
263 | WDOG_SET_PRETIMEOUT_ACT(data[1], preaction_val); | 263 | WDOG_SET_PRETIMEOUT_ACT(data[1], preaction_val); |
264 | data[2] = pretimeout; | 264 | data[2] = pretimeout; |
265 | } else { | 265 | } else { |
@@ -817,15 +817,19 @@ static void ipmi_register_watchdog(int ipmi_intf) | |||
817 | static int | 817 | static int |
818 | ipmi_nmi(void *dev_id, struct pt_regs *regs, int cpu, int handled) | 818 | ipmi_nmi(void *dev_id, struct pt_regs *regs, int cpu, int handled) |
819 | { | 819 | { |
820 | /* If we are not expecting a timeout, ignore it. */ | ||
821 | if (ipmi_watchdog_state == WDOG_TIMEOUT_NONE) | ||
822 | return NOTIFY_DONE; | ||
823 | |||
820 | /* If no one else handled the NMI, we assume it was the IPMI | 824 | /* If no one else handled the NMI, we assume it was the IPMI |
821 | watchdog. */ | 825 | watchdog. */ |
822 | if ((!handled) && (preop_val == WDOG_PREOP_PANIC)) | 826 | if ((!handled) && (preop_val == WDOG_PREOP_PANIC)) { |
827 | /* On some machines, the heartbeat will give | ||
828 | an error and not work unless we re-enable | ||
829 | the timer. So do so. */ | ||
830 | pretimeout_since_last_heartbeat = 1; | ||
823 | panic(PFX "pre-timeout"); | 831 | panic(PFX "pre-timeout"); |
824 | 832 | } | |
825 | /* On some machines, the heartbeat will give | ||
826 | an error and not work unless we re-enable | ||
827 | the timer. So do so. */ | ||
828 | pretimeout_since_last_heartbeat = 1; | ||
829 | 833 | ||
830 | return NOTIFY_DONE; | 834 | return NOTIFY_DONE; |
831 | } | 835 | } |