summaryrefslogtreecommitdiffstats
path: root/apphandler.cpp
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2017-07-29 22:38:28 -0700
committerPatrick Venture <venture@google.com>2017-08-15 18:12:43 -0700
commit6c50ad9d29672a64ad97348938c7866370d74841 (patch)
tree33d22524c28c7e846646f8250dc25f973fdf25d7 /apphandler.cpp
parent1bb0d387cd238a1d4b8c38c474433ccaada47a22 (diff)
downloadphosphor-host-ipmid-6c50ad9d29672a64ad97348938c7866370d74841.tar.gz
phosphor-host-ipmid-6c50ad9d29672a64ad97348938c7866370d74841.zip
Handle an action byte value of 0 in the set watchdog timer command
There are multiple options for the action field of the command. This change only addresses one, where the caller wants there to be no action taken when the timer expires. Because the implementation of the watchdog doesn't support multiple actions in precisely that arrangement, it makes sense to simply disable the timer. The default behaviour on x86 of the ipmi_watchdog driver is to first set the watchdog to 10s and an action of "none" and then set it to 10s with an action of "hard reset." This change is necessary to stop the watchdog from resetting the host when it receives the initial setting with the action of "none." Change-Id: I1a541824d2bd0d7a0c33ec5759c7c959cc2ae5ee Signed-off-by: Patrick Venture <venture@google.com>
Diffstat (limited to 'apphandler.cpp')
-rw-r--r--apphandler.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/apphandler.cpp b/apphandler.cpp
index 2251e8c..5145a0a 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -417,6 +417,16 @@ ipmi_ret_t ipmi_app_set_watchdog(ipmi_netfn_t netfn, ipmi_cmd_t cmd,
goto finish;
}
+ /*
+ * If the action is 0, it means, do nothing. Multiple actions on timer
+ * expiration aren't supported by phosphor-watchdog yet, so when the
+ * action set is "none", we should just leave the timer disabled.
+ */
+ if (0 == reqptr->t_action)
+ {
+ goto finish;
+ }
+
if (reqptr->t_use & 0x40)
{
sd_bus_error_free(&error);
OpenPOWER on IntegriCloud