diff options
author | William A. Kennington III <wak@google.com> | 2018-05-23 17:13:28 -0700 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-06-01 02:07:26 -0500 |
commit | b23d7714b4b84b9670f4fc301daef72186f832ce (patch) | |
tree | 0a61cf5854e2dad8a8e4ae618be7e20736ab52ac | |
parent | 27dec8f85b684ce85bb12d71d1e4432d0c835e52 (diff) | |
download | skiboot-b23d7714b4b84b9670f4fc301daef72186f832ce.zip skiboot-b23d7714b4b84b9670f4fc301daef72186f832ce.tar.gz skiboot-b23d7714b4b84b9670f4fc301daef72186f832ce.tar.bz2 |
ipmi-watchdog: Make it possible to set DONT_STOP
The IPMI standard supports setting a DONT_STOP bit during an Watchdog
Set operation. Most of the time we don't want to stop the Watchdog when
updating the settings so we should be using this bit. This patch makes
it possible for callers of set_wdt to prevent the watchdog from being
stopped. This only changes the behavior of the watchdog during the
initial settings update when initializing skiboot. The watchdog is no
longer disabled and then immediately re-enabled.
Signed-off-by: William A. Kennington III <wak@google.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
-rw-r--r-- | hw/ipmi/ipmi-watchdog.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/hw/ipmi/ipmi-watchdog.c b/hw/ipmi/ipmi-watchdog.c index 966d10d..ee16084 100644 --- a/hw/ipmi/ipmi-watchdog.c +++ b/hw/ipmi/ipmi-watchdog.c @@ -57,7 +57,8 @@ static void ipmi_wdt_complete(struct ipmi_msg *msg) ipmi_free_msg(msg); } -static void set_wdt(uint8_t action, uint16_t count, uint8_t pretimeout) +static void set_wdt(uint8_t action, uint16_t count, uint8_t pretimeout, + bool dont_stop) { struct ipmi_msg *ipmi_msg; @@ -69,7 +70,8 @@ static void set_wdt(uint8_t action, uint16_t count, uint8_t pretimeout) } ipmi_msg->error = ipmi_wdt_complete; ipmi_msg->data[0] = TIMER_USE_POST | - TIMER_USE_DONT_LOG; /* Timer Use */ + TIMER_USE_DONT_LOG | + (dont_stop ? TIMER_USE_DONT_STOP : 0); ipmi_msg->data[1] = action; /* Timer Actions */ ipmi_msg->data[2] = pretimeout; /* Pre-timeout Interval */ ipmi_msg->data[3] = 0; /* Timer Use Flags */ @@ -113,7 +115,7 @@ void ipmi_wdt_stop(void) { if (!wdt_stopped) { wdt_stopped = true; - set_wdt(WDT_NO_ACTION, 100, 0); + set_wdt(WDT_NO_ACTION, 100, 0, false); } } @@ -123,10 +125,10 @@ void ipmi_wdt_final_reset(void) * behaviour */ #if 0 set_wdt(WDT_RESET_ACTION | WDT_PRETIMEOUT_SMI, WDT_TIMEOUT, - WDT_MARGIN/10); + WDT_MARGIN/10, true); reset_wdt(NULL, (void *) 1); #endif - set_wdt(WDT_NO_ACTION, 100, 0); + set_wdt(WDT_NO_ACTION, 100, 0, false); ipmi_set_boot_count(); cancel_timer(&wdt_timer); } @@ -134,7 +136,7 @@ void ipmi_wdt_final_reset(void) void ipmi_wdt_init(void) { init_timer(&wdt_timer, reset_wdt, NULL); - set_wdt(WDT_RESET_ACTION, WDT_TIMEOUT, 0); + set_wdt(WDT_RESET_ACTION, WDT_TIMEOUT, 0, true); /* Start the WDT. We do it synchronously to make sure it has * started before skiboot continues booting. Otherwise we |