Commit 4a418baf authored by Dave Jones's avatar Dave Jones

[PATCH] watchdog nowayout for machzwd

Originally from Matt Domsch.
Adds a nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
From 2.4
parent 5de9c24a
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* a system RESET and it starts wd#2 that unconditionaly will RESET * a system RESET and it starts wd#2 that unconditionaly will RESET
* the system when the counter reaches zero. * the system when the counter reaches zero.
* *
* 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
* Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -103,6 +105,15 @@ MODULE_LICENSE("GPL"); ...@@ -103,6 +105,15 @@ MODULE_LICENSE("GPL");
MODULE_PARM(action, "i"); MODULE_PARM(action, "i");
MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"); MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI");
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static int nowayout = 1;
#else
static int nowayout = 0;
#endif
MODULE_PARM(nowayout,"i");
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)");
#define PFX "machzwd" #define PFX "machzwd"
static struct watchdog_info zf_info = { static struct watchdog_info zf_info = {
...@@ -307,7 +318,7 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count, ...@@ -307,7 +318,7 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count,
* no need to check for close confirmation * no need to check for close confirmation
* no way to disable watchdog ;) * no way to disable watchdog ;)
*/ */
#ifndef CONFIG_WATCHDOG_NOWAYOUT if (!nowayout) {
size_t ofs; size_t ofs;
/* /*
...@@ -323,7 +334,7 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count, ...@@ -323,7 +334,7 @@ static ssize_t zf_write(struct file *file, const char *buf, size_t count,
dprintk("zf_expect_close 1\n"); dprintk("zf_expect_close 1\n");
} }
} }
#endif }
/* /*
* Well, anyhow someone wrote to us, * Well, anyhow someone wrote to us,
* we should return that favour * we should return that favour
...@@ -386,9 +397,9 @@ static int zf_open(struct inode *inode, struct file *file) ...@@ -386,9 +397,9 @@ static int zf_open(struct inode *inode, struct file *file)
return -EBUSY; return -EBUSY;
} }
#ifdef CONFIG_WATCHDOG_NOWAYOUT if (nowayout) {
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
#endif }
zf_is_open = 1; zf_is_open = 1;
spin_unlock(&zf_lock); spin_unlock(&zf_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment