aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ipmi/ipmi_watchdog.c')
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 8f8867170973..1a0a19c53605 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -949,9 +949,10 @@ static int wdog_reboot_handler(struct notifier_block *this,
949 /* Disable the WDT if we are shutting down. */ 949 /* Disable the WDT if we are shutting down. */
950 ipmi_watchdog_state = WDOG_TIMEOUT_NONE; 950 ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
951 panic_halt_ipmi_set_timeout(); 951 panic_halt_ipmi_set_timeout();
952 } else { 952 } else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
953 /* Set a long timer to let the reboot happens, but 953 /* Set a long timer to let the reboot happens, but
954 reboot if it hangs. */ 954 reboot if it hangs, but only if the watchdog
955 timer was already running. */
955 timeout = 120; 956 timeout = 120;
956 pretimeout = 0; 957 pretimeout = 0;
957 ipmi_watchdog_state = WDOG_TIMEOUT_RESET; 958 ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
@@ -973,16 +974,17 @@ static int wdog_panic_handler(struct notifier_block *this,
973{ 974{
974 static int panic_event_handled = 0; 975 static int panic_event_handled = 0;
975 976
976 /* On a panic, if we have a panic timeout, make sure that the thing 977 /* On a panic, if we have a panic timeout, make sure to extend
977 reboots, even if it hangs during that panic. */ 978 the watchdog timer to a reasonable value to complete the
978 if (watchdog_user && !panic_event_handled) { 979 panic, if the watchdog timer is running. Plus the
979 /* Make sure the panic doesn't hang, and make sure we 980 pretimeout is meaningless at panic time. */
980 do this only once. */ 981 if (watchdog_user && !panic_event_handled &&
982 ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
983 /* Make sure we do this only once. */
981 panic_event_handled = 1; 984 panic_event_handled = 1;
982 985
983 timeout = 255; 986 timeout = 255;
984 pretimeout = 0; 987 pretimeout = 0;
985 ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
986 panic_halt_ipmi_set_timeout(); 988 panic_halt_ipmi_set_timeout();
987 } 989 }
988 990