From 6c50ad9d29672a64ad97348938c7866370d74841 Mon Sep 17 00:00:00 2001 From: Patrick Venture Date: Sat, 29 Jul 2017 22:38:28 -0700 Subject: 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 --- apphandler.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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); -- cgit v1.2.1