aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/machzwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/watchdog/machzwd.c')
-rw-r--r--drivers/char/watchdog/machzwd.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c
index 4d730fdbd528..81fb3dec180f 100644
--- a/drivers/char/watchdog/machzwd.c
+++ b/drivers/char/watchdog/machzwd.c
@@ -95,7 +95,7 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
95 95
96static int nowayout = WATCHDOG_NOWAYOUT; 96static int nowayout = WATCHDOG_NOWAYOUT;
97module_param(nowayout, int, 0); 97module_param(nowayout, int, 0);
98MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); 98MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
99 99
100#define PFX "machzwd" 100#define PFX "machzwd"
101 101
@@ -118,12 +118,14 @@ static int action = 0;
118module_param(action, int, 0); 118module_param(action, int, 0);
119MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"); 119MODULE_PARM_DESC(action, "after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI");
120 120
121static void zf_ping(unsigned long data);
122
121static int zf_action = GEN_RESET; 123static int zf_action = GEN_RESET;
122static unsigned long zf_is_open; 124static unsigned long zf_is_open;
123static char zf_expect_close; 125static char zf_expect_close;
124static spinlock_t zf_lock; 126static spinlock_t zf_lock;
125static spinlock_t zf_port_lock; 127static spinlock_t zf_port_lock;
126static struct timer_list zf_timer; 128static DEFINE_TIMER(zf_timer, zf_ping, 0, 0);
127static unsigned long next_heartbeat = 0; 129static unsigned long next_heartbeat = 0;
128 130
129 131
@@ -220,9 +222,7 @@ static void zf_timer_on(void)
220 next_heartbeat = jiffies + ZF_USER_TIMEO; 222 next_heartbeat = jiffies + ZF_USER_TIMEO;
221 223
222 /* start the timer for internal ping */ 224 /* start the timer for internal ping */
223 zf_timer.expires = jiffies + ZF_HW_TIMEO; 225 mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
224
225 add_timer(&zf_timer);
226 226
227 /* start watchdog timer */ 227 /* start watchdog timer */
228 ctrl_reg = zf_get_control(); 228 ctrl_reg = zf_get_control();
@@ -260,8 +260,7 @@ static void zf_ping(unsigned long data)
260 zf_set_control(ctrl_reg); 260 zf_set_control(ctrl_reg);
261 spin_unlock_irqrestore(&zf_port_lock, flags); 261 spin_unlock_irqrestore(&zf_port_lock, flags);
262 262
263 zf_timer.expires = jiffies + ZF_HW_TIMEO; 263 mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO);
264 add_timer(&zf_timer);
265 }else{ 264 }else{
266 printk(KERN_CRIT PFX ": I will reset your machine\n"); 265 printk(KERN_CRIT PFX ": I will reset your machine\n");
267 } 266 }
@@ -465,11 +464,6 @@ static int __init zf_init(void)
465 zf_set_status(0); 464 zf_set_status(0);
466 zf_set_control(0); 465 zf_set_control(0);
467 466
468 /* this is the timer that will do the hard work */
469 init_timer(&zf_timer);
470 zf_timer.function = zf_ping;
471 zf_timer.data = 0;
472
473 return 0; 467 return 0;
474 468
475no_reboot: 469no_reboot: