diff options
author | Corey Minyard <minyard@acm.org> | 2005-09-06 18:18:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:48 -0400 |
commit | 8f05ee9a63b414da4fd036a9dab2d27727301188 (patch) | |
tree | 97309901620848a9bc045dd88df6cc7eb2582ab0 /drivers/char/ipmi | |
parent | 75b0768a396f2a25901b7b1edc87b95cdb3af4ef (diff) |
[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 <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/ipmi')
-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 | } |