]> git.hungrycats.org Git - linux/commitdiff
[PATCH] convert ipmi_watchdog to use module option nowayout
authorArkadiusz Miskiewicz <arekm@pld-linux.org>
Wed, 28 Jul 2004 16:13:29 +0000 (09:13 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 28 Jul 2004 16:13:29 +0000 (09:13 -0700)
Convert ipmi_watchdog to also use module option `nowayout' as is done in
other watchdog drivers.

From: Corey Minyard <cminyard@mvista.com>

   The patch is good (same style as other watchdogs), but needs to have
   some documentation updated.  I've tacked that on.

Signed-off-by: Arkadiusz Miskiewicz <arekm@pld-linux.org>
Signed-off-by: Corey Minyard <minyard@acm.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Documentation/IPMI.txt
drivers/char/ipmi/ipmi_watchdog.c

index ec8a6fa2c34b2ba4c33acb58eac8f4874f4cff50..583eb0d58b25d2451e2cf545c2b480baa7c9b26b 100644 (file)
@@ -442,6 +442,7 @@ used to control it:
 
   modprobe ipmi_watchdog timeout=<t> pretimeout=<t> action=<action type>
       preaction=<preaction type> preop=<preop type> start_now=x
+      nowayout=x
 
 The timeout is the number of seconds to the action, and the pretimeout
 is the amount of seconds before the reset that the pre-timeout panic will
@@ -472,6 +473,10 @@ the device, as well.
 If start_now is set to 1, the watchdog timer will start running as
 soon as the driver is loaded.
 
+If nowayout is set to 1, the watchdog timer will not stop when the
+watchdog device is closed.  The default value of nowayout is true
+if the CONFIG_WATCHDOG_NOWAYOUT option is enabled, or false if not.
+
 When compiled into the kernel, the kernel command line is available
 for configuring the watchdog:
 
@@ -480,6 +485,7 @@ for configuring the watchdog:
        ipmi_watchdog.preaction=<preaction type>
        ipmi_watchdog.preop=<preop type>
        ipmi_watchdog.start_now=x
+       ipmi_watchdog.nowayout=x
 
 The options are the same as the module parameter options.
 
index f128109082b35d174f1a85f96937397ca0307157..59cf9b4083590d2baeff11abb9d31697e9744dcc 100644 (file)
 #define        WDIOC_GET_PRETIMEOUT     _IOW(WATCHDOG_IOCTL_BASE, 22, int)
 #endif
 
+#ifdef CONFIG_WATCHDOG_NOWAYOUT
+static int nowayout = 1;
+#else
+static int nowayout;
+#endif
+
 static ipmi_user_t watchdog_user = NULL;
 
 /* Default the timeout to 10 seconds. */
@@ -175,6 +181,8 @@ MODULE_PARM_DESC(preop, "Pretimeout driver operation.  One of: "
 module_param(start_now, int, 0);
 MODULE_PARM_DESC(start_now, "Set to 1 to start the watchdog as"
                 "soon as the driver is loaded.");
+module_param(nowayout, int, 0);
+MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
 
 /* Default state of the timer. */
 static unsigned char ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
@@ -704,10 +712,10 @@ static int ipmi_close(struct inode *ino, struct file *filep)
 {
        if (iminor(ino)==WATCHDOG_MINOR)
        {
-#ifndef CONFIG_WATCHDOG_NOWAYOUT       
-               ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
-               ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
-#endif         
+               if (!nowayout) {
+                       ipmi_watchdog_state = WDOG_TIMEOUT_NONE;
+                       ipmi_set_timeout(IPMI_SET_TIMEOUT_NO_HB);
+               }
                ipmi_wdog_open = 0;
        }