Skip to content

Commit

Permalink
ipmi-watchdog: The stop action should disable reset
Browse files Browse the repository at this point in the history
Otherwise it is possible for the reset timer to elapse and trigger the
watchdog to wake back up. This doesn't affect the behavior of the
system since we are providing a NONE action to the BMC. However we would
like to avoid the action from taking place if possible.

Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
wak-google authored and stewartsmith committed Jun 4, 2018
1 parent 5b70462 commit 651f204
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions hw/ipmi/ipmi-watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ static void reset_wdt(struct timer *t __unused, void *data __unused,
void ipmi_wdt_stop(void)
{
if (!wdt_stopped) {
/* Make sure the background reset timer is disabled before
* stopping the watchdog. If we issue a reset after disabling
* the timer, it will be re-enabled. */
wdt_ticking = false;
cancel_timer(&wdt_timer);

/* Configure the watchdog to be disabled and do no action
* in case the underlying implementation is buggy and times
* out anyway. */
wdt_stopped = true;
set_wdt(WDT_NO_ACTION, 100, 0, false);
}
Expand Down

0 comments on commit 651f204

Please sign in to comment.