diff options
author | Corey Minyard <cminyard@mvista.com> | 2012-03-28 17:42:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-03-28 20:14:36 -0400 |
commit | 423a5bb49ec530ec8bbfc73fd2ded83da8e58684 (patch) | |
tree | d70f4fedba821f80b5b4c2511fcf36aec07e9d03 /drivers/char | |
parent | f60adf42ad55405d1b17e9e5c33fdb63f1eb8861 (diff) |
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/ipmi/ipmi_watchdog.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c index 57a53ba7758c..99dc1daa4c37 100644 --- a/drivers/char/ipmi/ipmi_watchdog.c +++ b/drivers/char/ipmi/ipmi_watchdog.c | |||
@@ -1167,7 +1167,7 @@ static int wdog_reboot_handler(struct notifier_block *this, | |||
1167 | if (code == SYS_POWER_OFF || code == SYS_HALT) { | 1167 | if (code == SYS_POWER_OFF || code == SYS_HALT) { |
1168 | /* Disable the WDT if we are shutting down. */ | 1168 | /* Disable the WDT if we are shutting down. */ |
1169 | ipmi_watchdog_state = WDOG_TIMEOUT_NONE; | 1169 | ipmi_watchdog_state = WDOG_TIMEOUT_NONE; |
1170 | panic_halt_ipmi_set_timeout(); | 1170 | ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); |
1171 | } else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) { | 1171 | } else if (ipmi_watchdog_state != WDOG_TIMEOUT_NONE) { |
1172 | /* Set a long timer to let the reboot happens, but | 1172 | /* Set a long timer to let the reboot happens, but |
1173 | reboot if it hangs, but only if the watchdog | 1173 | reboot if it hangs, but only if the watchdog |
@@ -1175,7 +1175,7 @@ static int wdog_reboot_handler(struct notifier_block *this, | |||
1175 | timeout = 120; | 1175 | timeout = 120; |
1176 | pretimeout = 0; | 1176 | pretimeout = 0; |
1177 | ipmi_watchdog_state = WDOG_TIMEOUT_RESET; | 1177 | ipmi_watchdog_state = WDOG_TIMEOUT_RESET; |
1178 | panic_halt_ipmi_set_timeout(); | 1178 | ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB); |
1179 | } | 1179 | } |
1180 | } | 1180 | } |
1181 | return NOTIFY_OK; | 1181 | return NOTIFY_OK; |