diff options
author | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 09:00:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 09:00:45 -0400 |
commit | 67d2c36e901403bb97cb79ddb44d702c3284d0ba (patch) | |
tree | 872805a9402f8186584075f1a8cf804b9606efea /drivers/char/watchdog | |
parent | 94f8c66e5e543d79231abf203d6e514ecb668688 (diff) | |
parent | 1cc77248106aafc12ba529953f652d6f8db2c84d (diff) |
Merge watchdog driver updates
Automated merge from
master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
failed due to duplicate different changes to Kconfig file. Manually fixed
up. Hopefully.
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r-- | drivers/char/watchdog/Makefile | 71 | ||||
-rw-r--r-- | drivers/char/watchdog/ixp2000_wdt.c | 2 | ||||
-rw-r--r-- | drivers/char/watchdog/ixp4xx_wdt.c | 2 | ||||
-rw-r--r-- | drivers/char/watchdog/s3c2410_wdt.c | 87 | ||||
-rw-r--r-- | drivers/char/watchdog/scx200_wdt.c | 2 | ||||
-rw-r--r-- | drivers/char/watchdog/softdog.c | 13 | ||||
-rw-r--r-- | drivers/char/watchdog/w83627hf_wdt.c | 6 |
7 files changed, 121 insertions, 62 deletions
diff --git a/drivers/char/watchdog/Makefile b/drivers/char/watchdog/Makefile index b16dfea28134..cfeac6f10137 100644 --- a/drivers/char/watchdog/Makefile +++ b/drivers/char/watchdog/Makefile | |||
@@ -2,43 +2,68 @@ | |||
2 | # Makefile for the WatchDog device drivers. | 2 | # Makefile for the WatchDog device drivers. |
3 | # | 3 | # |
4 | 4 | ||
5 | # Only one watchdog can succeed. We probe the ISA/PCI/USB based | ||
6 | # watchdog-cards first, then the architecture specific watchdog | ||
7 | # drivers and then the architecture independant "softdog" driver. | ||
8 | # This means that if your ISA/PCI/USB card isn't detected that | ||
9 | # you can fall back to an architecture specific driver and if | ||
10 | # that also fails then you can fall back to the software watchdog | ||
11 | # to give you some cover. | ||
12 | |||
13 | # ISA-based Watchdog Cards | ||
5 | obj-$(CONFIG_PCWATCHDOG) += pcwd.o | 14 | obj-$(CONFIG_PCWATCHDOG) += pcwd.o |
6 | obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o | ||
7 | obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o | ||
8 | obj-$(CONFIG_IB700_WDT) += ib700wdt.o | ||
9 | obj-$(CONFIG_MIXCOMWD) += mixcomwd.o | 15 | obj-$(CONFIG_MIXCOMWD) += mixcomwd.o |
10 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o | ||
11 | obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o | ||
12 | obj-$(CONFIG_WDT) += wdt.o | 16 | obj-$(CONFIG_WDT) += wdt.o |
17 | |||
18 | # PCI-based Watchdog Cards | ||
19 | obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o | ||
13 | obj-$(CONFIG_WDTPCI) += wdt_pci.o | 20 | obj-$(CONFIG_WDTPCI) += wdt_pci.o |
21 | |||
22 | # USB-based Watchdog Cards | ||
23 | obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o | ||
24 | |||
25 | # ARM Architecture | ||
14 | obj-$(CONFIG_21285_WATCHDOG) += wdt285.o | 26 | obj-$(CONFIG_21285_WATCHDOG) += wdt285.o |
15 | obj-$(CONFIG_977_WATCHDOG) += wdt977.o | 27 | obj-$(CONFIG_977_WATCHDOG) += wdt977.o |
16 | obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o | 28 | obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o |
17 | obj-$(CONFIG_MACHZ_WDT) += machzwd.o | 29 | obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o |
18 | obj-$(CONFIG_SH_WDT) += shwdt.o | ||
19 | obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o | 30 | obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o |
20 | obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o | 31 | obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o |
21 | obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o | 32 | |
22 | obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o | 33 | # X86 (i386 + ia64 + x86_64) Architecture |
23 | obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o | 34 | obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o |
24 | obj-$(CONFIG_SC520_WDT) += sc520_wdt.o | 35 | obj-$(CONFIG_ADVANTECH_WDT) += advantechwdt.o |
25 | obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o | ||
26 | obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o | 36 | obj-$(CONFIG_ALIM1535_WDT) += alim1535_wdt.o |
27 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o | 37 | obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o |
38 | obj-$(CONFIG_SC520_WDT) += sc520_wdt.o | ||
39 | obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o | ||
40 | obj-$(CONFIG_IB700_WDT) += ib700wdt.o | ||
28 | obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o | 41 | obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o |
42 | obj-$(CONFIG_I8XX_TCO) += i8xx_tco.o | ||
43 | obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o | ||
44 | obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o | ||
45 | obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o | ||
29 | obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o | 46 | obj-$(CONFIG_CPU5_WDT) += cpu5wdt.o |
30 | obj-$(CONFIG_INDYDOG) += indydog.o | 47 | obj-$(CONFIG_W83627HF_WDT) += w83627hf_wdt.o |
31 | obj-$(CONFIG_PCIPCWATCHDOG) += pcwd_pci.o | 48 | obj-$(CONFIG_W83877F_WDT) += w83877f_wdt.o |
32 | obj-$(CONFIG_USBPCWATCHDOG) += pcwd_usb.o | 49 | obj-$(CONFIG_MACHZ_WDT) += machzwd.o |
33 | obj-$(CONFIG_IXP4XX_WATCHDOG) += ixp4xx_wdt.o | 50 | |
34 | obj-$(CONFIG_IXP2000_WATCHDOG) += ixp2000_wdt.o | 51 | # PowerPC Architecture |
35 | obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o | 52 | obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o |
53 | |||
54 | # PPC64 Architecture | ||
36 | obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o | 55 | obj-$(CONFIG_WATCHDOG_RTAS) += wdrtas.o |
37 | obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o | 56 | obj-$(CONFIG_BOOKE_WDT) += booke_wdt.o |
38 | 57 | ||
39 | # Only one watchdog can succeed. We probe the hardware watchdog | 58 | # MIPS Architecture |
40 | # drivers first, then the softdog driver. This means if your hardware | 59 | obj-$(CONFIG_INDYDOG) += indydog.o |
41 | # watchdog dies or is 'borrowed' for some reason the software watchdog | 60 | |
42 | # still gives you some cover. | 61 | # S390 Architecture |
62 | |||
63 | # SUPERH Architecture | ||
64 | obj-$(CONFIG_SH_WDT) += shwdt.o | ||
65 | |||
66 | # SPARC64 Architecture | ||
43 | 67 | ||
68 | # Architecture Independant | ||
44 | obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o | 69 | obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o |
diff --git a/drivers/char/watchdog/ixp2000_wdt.c b/drivers/char/watchdog/ixp2000_wdt.c index e7640bc4904b..0cfb9b9c4a4b 100644 --- a/drivers/char/watchdog/ixp2000_wdt.c +++ b/drivers/char/watchdog/ixp2000_wdt.c | |||
@@ -182,7 +182,7 @@ static struct file_operations ixp2000_wdt_fops = | |||
182 | static struct miscdevice ixp2000_wdt_miscdev = | 182 | static struct miscdevice ixp2000_wdt_miscdev = |
183 | { | 183 | { |
184 | .minor = WATCHDOG_MINOR, | 184 | .minor = WATCHDOG_MINOR, |
185 | .name = "IXP2000 Watchdog", | 185 | .name = "watchdog", |
186 | .fops = &ixp2000_wdt_fops, | 186 | .fops = &ixp2000_wdt_fops, |
187 | }; | 187 | }; |
188 | 188 | ||
diff --git a/drivers/char/watchdog/ixp4xx_wdt.c b/drivers/char/watchdog/ixp4xx_wdt.c index 8d916afbf4fa..b5be8b11104a 100644 --- a/drivers/char/watchdog/ixp4xx_wdt.c +++ b/drivers/char/watchdog/ixp4xx_wdt.c | |||
@@ -176,7 +176,7 @@ static struct file_operations ixp4xx_wdt_fops = | |||
176 | static struct miscdevice ixp4xx_wdt_miscdev = | 176 | static struct miscdevice ixp4xx_wdt_miscdev = |
177 | { | 177 | { |
178 | .minor = WATCHDOG_MINOR, | 178 | .minor = WATCHDOG_MINOR, |
179 | .name = "IXP4xx Watchdog", | 179 | .name = "watchdog", |
180 | .fops = &ixp4xx_wdt_fops, | 180 | .fops = &ixp4xx_wdt_fops, |
181 | }; | 181 | }; |
182 | 182 | ||
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index f85ac898a49a..8b292bf343c4 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -27,7 +27,10 @@ | |||
27 | * Fixed tmr_count / wdt_count confusion | 27 | * Fixed tmr_count / wdt_count confusion |
28 | * Added configurable debug | 28 | * Added configurable debug |
29 | * | 29 | * |
30 | * 11-Jan-2004 BJD Fixed divide-by-2 in timeout code | 30 | * 11-Jan-2005 BJD Fixed divide-by-2 in timeout code |
31 | * | ||
32 | * 25-Jan-2005 DA Added suspend/resume support | ||
33 | * Replaced reboot notifier with .shutdown method | ||
31 | * | 34 | * |
32 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA | 35 | * 10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA |
33 | */ | 36 | */ |
@@ -40,8 +43,6 @@ | |||
40 | #include <linux/miscdevice.h> | 43 | #include <linux/miscdevice.h> |
41 | #include <linux/watchdog.h> | 44 | #include <linux/watchdog.h> |
42 | #include <linux/fs.h> | 45 | #include <linux/fs.h> |
43 | #include <linux/notifier.h> | ||
44 | #include <linux/reboot.h> | ||
45 | #include <linux/init.h> | 46 | #include <linux/init.h> |
46 | #include <linux/device.h> | 47 | #include <linux/device.h> |
47 | #include <linux/interrupt.h> | 48 | #include <linux/interrupt.h> |
@@ -317,20 +318,6 @@ static int s3c2410wdt_ioctl(struct inode *inode, struct file *file, | |||
317 | } | 318 | } |
318 | } | 319 | } |
319 | 320 | ||
320 | /* | ||
321 | * Notifier for system down | ||
322 | */ | ||
323 | |||
324 | static int s3c2410wdt_notify_sys(struct notifier_block *this, unsigned long code, | ||
325 | void *unused) | ||
326 | { | ||
327 | if(code==SYS_DOWN || code==SYS_HALT) { | ||
328 | /* Turn the WDT off */ | ||
329 | s3c2410wdt_stop(); | ||
330 | } | ||
331 | return NOTIFY_DONE; | ||
332 | } | ||
333 | |||
334 | /* kernel interface */ | 321 | /* kernel interface */ |
335 | 322 | ||
336 | static struct file_operations s3c2410wdt_fops = { | 323 | static struct file_operations s3c2410wdt_fops = { |
@@ -348,10 +335,6 @@ static struct miscdevice s3c2410wdt_miscdev = { | |||
348 | .fops = &s3c2410wdt_fops, | 335 | .fops = &s3c2410wdt_fops, |
349 | }; | 336 | }; |
350 | 337 | ||
351 | static struct notifier_block s3c2410wdt_notifier = { | ||
352 | .notifier_call = s3c2410wdt_notify_sys, | ||
353 | }; | ||
354 | |||
355 | /* interrupt handler code */ | 338 | /* interrupt handler code */ |
356 | 339 | ||
357 | static irqreturn_t s3c2410wdt_irq(int irqno, void *param, | 340 | static irqreturn_t s3c2410wdt_irq(int irqno, void *param, |
@@ -432,18 +415,10 @@ static int s3c2410wdt_probe(struct device *dev) | |||
432 | } | 415 | } |
433 | } | 416 | } |
434 | 417 | ||
435 | ret = register_reboot_notifier(&s3c2410wdt_notifier); | ||
436 | if (ret) { | ||
437 | printk (KERN_ERR PFX "cannot register reboot notifier (%d)\n", | ||
438 | ret); | ||
439 | return ret; | ||
440 | } | ||
441 | |||
442 | ret = misc_register(&s3c2410wdt_miscdev); | 418 | ret = misc_register(&s3c2410wdt_miscdev); |
443 | if (ret) { | 419 | if (ret) { |
444 | printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", | 420 | printk (KERN_ERR PFX "cannot register miscdev on minor=%d (%d)\n", |
445 | WATCHDOG_MINOR, ret); | 421 | WATCHDOG_MINOR, ret); |
446 | unregister_reboot_notifier(&s3c2410wdt_notifier); | ||
447 | return ret; | 422 | return ret; |
448 | } | 423 | } |
449 | 424 | ||
@@ -479,15 +454,63 @@ static int s3c2410wdt_remove(struct device *dev) | |||
479 | return 0; | 454 | return 0; |
480 | } | 455 | } |
481 | 456 | ||
457 | static void s3c2410wdt_shutdown(struct device *dev) | ||
458 | { | ||
459 | s3c2410wdt_stop(); | ||
460 | } | ||
461 | |||
462 | #ifdef CONFIG_PM | ||
463 | |||
464 | static unsigned long wtcon_save; | ||
465 | static unsigned long wtdat_save; | ||
466 | |||
467 | static int s3c2410wdt_suspend(struct device *dev, u32 state, u32 level) | ||
468 | { | ||
469 | if (level == SUSPEND_POWER_DOWN) { | ||
470 | /* Save watchdog state, and turn it off. */ | ||
471 | wtcon_save = readl(wdt_base + S3C2410_WTCON); | ||
472 | wtdat_save = readl(wdt_base + S3C2410_WTDAT); | ||
473 | |||
474 | /* Note that WTCNT doesn't need to be saved. */ | ||
475 | s3c2410wdt_stop(); | ||
476 | } | ||
477 | |||
478 | return 0; | ||
479 | } | ||
480 | |||
481 | static int s3c2410wdt_resume(struct device *dev, u32 level) | ||
482 | { | ||
483 | if (level == RESUME_POWER_ON) { | ||
484 | /* Restore watchdog state. */ | ||
485 | |||
486 | writel(wtdat_save, wdt_base + S3C2410_WTDAT); | ||
487 | writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ | ||
488 | writel(wtcon_save, wdt_base + S3C2410_WTCON); | ||
489 | |||
490 | printk(KERN_INFO PFX "watchdog %sabled\n", | ||
491 | (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); | ||
492 | } | ||
493 | |||
494 | return 0; | ||
495 | } | ||
496 | |||
497 | #else | ||
498 | #define s3c2410wdt_suspend NULL | ||
499 | #define s3c2410wdt_resume NULL | ||
500 | #endif /* CONFIG_PM */ | ||
501 | |||
502 | |||
482 | static struct device_driver s3c2410wdt_driver = { | 503 | static struct device_driver s3c2410wdt_driver = { |
483 | .name = "s3c2410-wdt", | 504 | .name = "s3c2410-wdt", |
484 | .bus = &platform_bus_type, | 505 | .bus = &platform_bus_type, |
485 | .probe = s3c2410wdt_probe, | 506 | .probe = s3c2410wdt_probe, |
486 | .remove = s3c2410wdt_remove, | 507 | .remove = s3c2410wdt_remove, |
508 | .shutdown = s3c2410wdt_shutdown, | ||
509 | .suspend = s3c2410wdt_suspend, | ||
510 | .resume = s3c2410wdt_resume, | ||
487 | }; | 511 | }; |
488 | 512 | ||
489 | 513 | ||
490 | |||
491 | static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; | 514 | static char banner[] __initdata = KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; |
492 | 515 | ||
493 | static int __init watchdog_init(void) | 516 | static int __init watchdog_init(void) |
@@ -499,13 +522,13 @@ static int __init watchdog_init(void) | |||
499 | static void __exit watchdog_exit(void) | 522 | static void __exit watchdog_exit(void) |
500 | { | 523 | { |
501 | driver_unregister(&s3c2410wdt_driver); | 524 | driver_unregister(&s3c2410wdt_driver); |
502 | unregister_reboot_notifier(&s3c2410wdt_notifier); | ||
503 | } | 525 | } |
504 | 526 | ||
505 | module_init(watchdog_init); | 527 | module_init(watchdog_init); |
506 | module_exit(watchdog_exit); | 528 | module_exit(watchdog_exit); |
507 | 529 | ||
508 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 530 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>, " |
531 | "Dimitry Andric <dimitry.andric@tomtom.com>"); | ||
509 | MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); | 532 | MODULE_DESCRIPTION("S3C2410 Watchdog Device Driver"); |
510 | MODULE_LICENSE("GPL"); | 533 | MODULE_LICENSE("GPL"); |
511 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); | 534 | MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); |
diff --git a/drivers/char/watchdog/scx200_wdt.c b/drivers/char/watchdog/scx200_wdt.c index c4568569f3a8..b4a102a2d7e3 100644 --- a/drivers/char/watchdog/scx200_wdt.c +++ b/drivers/char/watchdog/scx200_wdt.c | |||
@@ -206,7 +206,7 @@ static struct file_operations scx200_wdt_fops = { | |||
206 | 206 | ||
207 | static struct miscdevice scx200_wdt_miscdev = { | 207 | static struct miscdevice scx200_wdt_miscdev = { |
208 | .minor = WATCHDOG_MINOR, | 208 | .minor = WATCHDOG_MINOR, |
209 | .name = NAME, | 209 | .name = "watchdog", |
210 | .fops = &scx200_wdt_fops, | 210 | .fops = &scx200_wdt_fops, |
211 | }; | 211 | }; |
212 | 212 | ||
diff --git a/drivers/char/watchdog/softdog.c b/drivers/char/watchdog/softdog.c index 4d7ed931f5c6..20e5eb8667f2 100644 --- a/drivers/char/watchdog/softdog.c +++ b/drivers/char/watchdog/softdog.c | |||
@@ -77,7 +77,7 @@ static void watchdog_fire(unsigned long); | |||
77 | 77 | ||
78 | static struct timer_list watchdog_ticktock = | 78 | static struct timer_list watchdog_ticktock = |
79 | TIMER_INITIALIZER(watchdog_fire, 0, 0); | 79 | TIMER_INITIALIZER(watchdog_fire, 0, 0); |
80 | static unsigned long timer_alive; | 80 | static unsigned long driver_open, orphan_timer; |
81 | static char expect_close; | 81 | static char expect_close; |
82 | 82 | ||
83 | 83 | ||
@@ -87,6 +87,9 @@ static char expect_close; | |||
87 | 87 | ||
88 | static void watchdog_fire(unsigned long data) | 88 | static void watchdog_fire(unsigned long data) |
89 | { | 89 | { |
90 | if (test_and_clear_bit(0, &orphan_timer)) | ||
91 | module_put(THIS_MODULE); | ||
92 | |||
90 | if (soft_noboot) | 93 | if (soft_noboot) |
91 | printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); | 94 | printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); |
92 | else | 95 | else |
@@ -128,9 +131,9 @@ static int softdog_set_heartbeat(int t) | |||
128 | 131 | ||
129 | static int softdog_open(struct inode *inode, struct file *file) | 132 | static int softdog_open(struct inode *inode, struct file *file) |
130 | { | 133 | { |
131 | if(test_and_set_bit(0, &timer_alive)) | 134 | if (test_and_set_bit(0, &driver_open)) |
132 | return -EBUSY; | 135 | return -EBUSY; |
133 | if (nowayout) | 136 | if (!test_and_clear_bit(0, &orphan_timer)) |
134 | __module_get(THIS_MODULE); | 137 | __module_get(THIS_MODULE); |
135 | /* | 138 | /* |
136 | * Activate timer | 139 | * Activate timer |
@@ -147,11 +150,13 @@ static int softdog_release(struct inode *inode, struct file *file) | |||
147 | */ | 150 | */ |
148 | if (expect_close == 42) { | 151 | if (expect_close == 42) { |
149 | softdog_stop(); | 152 | softdog_stop(); |
153 | module_put(THIS_MODULE); | ||
150 | } else { | 154 | } else { |
151 | printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); | 155 | printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); |
156 | set_bit(0, &orphan_timer); | ||
152 | softdog_keepalive(); | 157 | softdog_keepalive(); |
153 | } | 158 | } |
154 | clear_bit(0, &timer_alive); | 159 | clear_bit(0, &driver_open); |
155 | expect_close = 0; | 160 | expect_close = 0; |
156 | return 0; | 161 | return 0; |
157 | } | 162 | } |
diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c index 465e0fd0423d..b5d821015421 100644 --- a/drivers/char/watchdog/w83627hf_wdt.c +++ b/drivers/char/watchdog/w83627hf_wdt.c | |||
@@ -93,6 +93,12 @@ w83627hf_init(void) | |||
93 | 93 | ||
94 | w83627hf_select_wd_register(); | 94 | w83627hf_select_wd_register(); |
95 | 95 | ||
96 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | ||
97 | t=inb_p(WDT_EFDR); /* read CRF6 */ | ||
98 | if (t != 0) { | ||
99 | printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout); | ||
100 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | ||
101 | } | ||
96 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ | 102 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ |
97 | t=inb_p(WDT_EFDR); /* read CRF5 */ | 103 | t=inb_p(WDT_EFDR); /* read CRF5 */ |
98 | t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */ | 104 | t&=~0x0C; /* set second mode & disable keyboard turning off watchdog */ |