ipmi: use locks on watchdog timeout set on reboot
The IPMI watchdog timer clears or extends the timer on reboot/shutdown. It was using the non-locking routine for setting the watchdog timer, but this was causing race conditions. Instead, use the locking version to avoid the races. It seems to work fine. Signed-off-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
f60adf42ad
commit
423a5bb49e
@@ -1167,7 +1167,7 @@ static int wdog_reboot_handler(struct notifier_block *this,
|
|||||||
if (code == SYS_POWER_OFF || code == SYS_HALT) {
|
if (code == SYS_POWER_OFF || code == SYS_HALT) {
|
||||||
/* 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();
|
ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
|
||||||
} else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) {
|
} 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, but only if the watchdog
|
reboot if it hangs, but only if the watchdog
|
||||||
@@ -1175,7 +1175,7 @@ static int wdog_reboot_handler(struct notifier_block *this,
|
|||||||
timeout = 120;
|
timeout = 120;
|
||||||
pretimeout = 0;
|
pretimeout = 0;
|
||||||
ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
|
ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
|
||||||
panic_halt_ipmi_set_timeout();
|
ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NOTIFY_OK;
|
return NOTIFY_OK;
|
||||||
|
Reference in New Issue
Block a user