Commit 96febe9f authored by Corey Minyard's avatar Corey Minyard Committed by Linus Torvalds

[PATCH] IPMI: watchdog handle panic properly

Modify the watchdog timeout in IPMI to only do things at panic/reboot time if
the watchdog timer was already running.  Some BIOSes do not disable the
watchdog timer at startup, and this led to a reboot a while later if the new
OS running didn't start monitoring the watchdog, even if the watchdog was not
running before.
Signed-off-by: default avatarCorey Minyard <minyard@acm.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1a245866
...@@ -949,9 +949,10 @@ static int wdog_reboot_handler(struct notifier_block *this, ...@@ -949,9 +949,10 @@ static int wdog_reboot_handler(struct notifier_block *this,
/* Disable the WDT if we are shutting down. */ /* Disable the WDT if we are shutting down. */
ipmi_watchdog_state = WDOG_TIMEOUT_NONE; ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
panic_halt_ipmi_set_timeout(); panic_halt_ipmi_set_timeout();
} else { } else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
/* Set a long timer to let the reboot happens, but /* Set a long timer to let the reboot happens, but
reboot if it hangs. */ reboot if it hangs, but only if the watchdog
timer was already running. */
timeout = 120; timeout = 120;
pretimeout = 0; pretimeout = 0;
ipmi_watchdog_state = WDOG_TIMEOUT_RESET; ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
...@@ -973,16 +974,17 @@ static int wdog_panic_handler(struct notifier_block *this, ...@@ -973,16 +974,17 @@ static int wdog_panic_handler(struct notifier_block *this,
{ {
static int panic_event_handled = 0; static int panic_event_handled = 0;
/* On a panic, if we have a panic timeout, make sure that the thing /* On a panic, if we have a panic timeout, make sure to extend
reboots, even if it hangs during that panic. */ the watchdog timer to a reasonable value to complete the
if (watchdog_user && !panic_event_handled) { panic, if the watchdog timer is running. Plus the
/* Make sure the panic doesn't hang, and make sure we pretimeout is meaningless at panic time. */
do this only once. */ if (watchdog_user && !panic_event_handled &&
ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
/* Make sure we do this only once. */
panic_event_handled = 1; panic_event_handled = 1;
timeout = 255; timeout = 255;
pretimeout = 0; pretimeout = 0;
ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
panic_halt_ipmi_set_timeout(); panic_halt_ipmi_set_timeout();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment