lkml.org 
[lkml]   [1999]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] wdt watchdog and HZ > 100
Hi!

This patch fixes a problem with the wdt watchdog driver for HZ != 100...
In case you defined HZ to be > 100, your machine might reboot some seconds
after startup.
The patch is agains 2.2.0-pre1, but there changed nothing since a long
long time...

Jan-Benedict Glaw

--- drivers/char/wdt.c.orig Sat Jan 2 02:54:39 1999
+++ drivers/char/wdt.c Sat Jan 2 03:16:36 1999
@@ -24,6 +24,7 @@
* Matt Crocker).
* Alan Cox : Added wdt= boot option
* Alan Cox : Cleaned up copy/user stuff
+ * Jan-B. Glaw : Fixed HZ stuff
*/

#include <linux/config.h>
@@ -56,7 +57,7 @@
static int io=0x240;
static int irq=11;

-#define WD_TIMO (100*60) /* 1 minute */
+#define WD_TIMO (HZ*60) /* 1 minute */

/*
* Setup options
@@ -257,8 +258,9 @@
wdt_ctr_mode(0,3);
wdt_ctr_mode(1,2);
wdt_ctr_mode(2,0);
- wdt_ctr_load(0, 8948); /* count at 100Hz */
- wdt_ctr_load(1,WD_TIMO); /* Timeout 120 seconds */
+ wdt_ctr_load(0, 894886/HZ); /* There's a clock at 894k886Hz*/
+ /* We need counts per HZ */
+ wdt_ctr_load(1,WD_TIMO); /* Timeout 60 seconds */
wdt_ctr_load(2,65535);
outb_p(0, WDT_DC); /* Enable */
return 0;
\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.032 / U:0.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site