[PATCH] iTCO_wdt: Don't double the requested timeout

From: Pádraig Brady
Date: Tue Feb 23 2010 - 12:14:35 EST


Actually looking at that code I noticed that it wasn't
accounting for the timer counting down twice before reboot,
which I thought was the case for ICH4 at least.
The following is not even compiled, nor am I sure it
applies to TCO v2. Testing/info appreciated.
I might be able to dig out an ICH4 system at some stage.

cheers,
Pádraig.

--- a/iTCO_wdt.c 2009-06-10 03:05:27.000000000 +0000
+++ b/iTCO_wdt.c 2010-02-23 17:02:07.829640740 +0000
@@ -274,7 +274,7 @@
static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
- "(2<heartbeat<39 (TCO v1) or 613 (TCO v2), default="
+ "(4<heartbeat<78 (TCO v1) or 1226 (TCO v2), default="
__MODULE_STRING(WATCHDOG_HEARTBEAT) ")");

static int nowayout = WATCHDOG_NOWAYOUT;
@@ -290,8 +290,8 @@
static inline unsigned int seconds_to_ticks(int seconds)
{
/* the internal timer is stored as ticks which decrement
- * every 0.6 seconds */
- return (seconds * 10) / 6;
+ * every 0.6 seconds. The timer counts down twice before reboot */
+ return (seconds * 10) / 3;
}

static void iTCO_wdt_set_NO_REBOOT_bit(void)
@@ -721,8 +721,8 @@
if (iTCO_wdt_set_heartbeat(heartbeat)) {
iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
printk(KERN_INFO PFX
- "heartbeat value must be 2 < heartbeat < 39 (TCO v1) "
- "or 613 (TCO v2), using %d\n", heartbeat);
+ "heartbeat value must be 4 < heartbeat < 78 (TCO v1) "
+ "or 1226 (TCO v2), using %d\n", heartbeat);
}

ret = misc_register(&iTCO_wdt_miscdev);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/