Date: Wed, 17 Aug 2005 07:06:07 +0000 (+0200) From: =?ISO-8859-1?Q?P=E1draig_Brady?= Subject: [WATCHDOG] w83627hf_wdt.c-initialized_bios_bug X-Git-Tag: v2.6.14~1279^2~1 X-Git-Url: http://git.eu.kernel.org/?p=linux%2Fkernel%2Fgit%2Fwim%2Flinux-2.6-watchdog.git;a=commitdiff_plain;h=93642ecd463df30d032da8ac37c2676cee4ad876 [WATCHDOG] w83627hf_wdt.c-initialized_bios_bug 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 Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/char/watchdog/w83627hf_wdt.c b/drivers/char/watchdog/w83627hf_wdt.c index 465e0fd..b5d8210 100644 --- a/drivers/char/watchdog/w83627hf_wdt.c +++ b/drivers/char/watchdog/w83627hf_wdt.c @@ -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 */