]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[WATCHDOG] w83627hf_wdt.c-initialized_bios_bug
authorP@Draig Brady <P@draigBrady.com>
Wed, 17 Aug 2005 07:06:07 +0000 (09:06 +0200)
committerWim Van Sebroeck <wim@iguana.be>
Sat, 3 Sep 2005 11:58:03 +0000 (13:58 +0200)
Attached is a small update to the w83627hf watchdog driver
to initialise appropriately if it was already initialised
in the BIOS. On tyan motherboards for e.g. you can init
the watchdog to 4 mins, then when the driver is loaded it
sets the watchdog to "seconds" mode, and then machine will
reboot within 4 seconds. So this patch resets the timeout
to the configured value if the watchdog is already running.

Signed-off-by: P@draig Brady <P@draigBrady.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/char/watchdog/w83627hf_wdt.c

index 465e0fd0423d48b2c405836ac428a14af8c37a09..b5d8210154216bec46da66ae16ede0793746010f 100644 (file)
@@ -93,6 +93,12 @@ w83627hf_init(void)
 
        w83627hf_select_wd_register();
 
+       outb_p(0xF6, WDT_EFER); /* Select CRF6 */
+       t=inb_p(WDT_EFDR);      /* read CRF6 */
+       if (t != 0) {
+               printk (KERN_INFO PFX "Watchdog already running. Resetting timeout to %d sec\n", timeout);
+               outb_p(timeout, WDT_EFDR);    /* Write back to CRF6 */
+       }
        outb_p(0xF5, WDT_EFER); /* Select CRF5 */
        t=inb_p(WDT_EFDR);      /* read CRF5 */
        t&=~0x0C;               /* set second mode & disable keyboard turning off watchdog */