diff mbox series

[07/10] ipmi:watchdog: Allow the reboot timeout to be specified

Message ID 20200620174907.20229-8-minyard@acm.org (mailing list archive)
State Changes Requested
Headers show
Series Convert the IPMI watchdog to use the watchdog | expand

Commit Message

Corey Minyard June 20, 2020, 5:49 p.m. UTC
From: Corey Minyard <cminyard@mvista.com>

It was fixed at 120, allow that to be changed.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
---
 drivers/char/ipmi/ipmi_watchdog.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index 9265a5145691..6e0c9faa6e6a 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -140,6 +140,9 @@  static int pretimeout;
 /* Default timeout to set on panic */
 static int panic_wdt_timeout = 255;
 
+/* Default timeout to set on reboot */
+static int reboot_wdt_timeout = 120;
+
 /* Default action is to reset the board on a timeout. */
 static unsigned char action_val = WDOG_TIMEOUT_RESET;
 
@@ -318,6 +321,9 @@  MODULE_PARM_DESC(pretimeout, "Pretimeout value in seconds.");
 module_param(panic_wdt_timeout, timeout, 0644);
 MODULE_PARM_DESC(panic_wdt_timeout, "Timeout value on kernel panic in seconds.");
 
+module_param(reboot_wdt_timeout, timeout, 0644);
+MODULE_PARM_DESC(reboot_wdt_timeout, "Timeout value on a reboot in seconds.");
+
 module_param_cb(action, &param_ops_str, action_op, 0644);
 MODULE_PARM_DESC(action, "Timeout action. One of: "
 		 "reset, none, power_cycle, power_off.");
@@ -1077,8 +1083,8 @@  static int wdog_reboot_handler(struct notifier_block *this,
 			/* Set a long timer to let the reboot happen or
 			   reset if it hangs, but only if the watchdog
 			   timer was already running. */
-			if (timeout < 120)
-				timeout = 120;
+			if (timeout < reboot_wdt_timeout)
+				timeout = reboot_wdt_timeout;
 			pretimeout = 0;
 			ipmi_watchdog_state = WDOG_TIMEOUT_RESET;
 			ipmi_set_timeout(&ipmi_wdd, IPMI_SET_TIMEOUT_NO_HB);