Commit fc61e83a authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

watchdog: Revert "iTCO_wdt: all versions count down twice"

This reverts commit 1fccb730.
Reported as Bug 196509 - iTCO_wdt regression reboot before timeout expire
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 0e271fd5
...@@ -117,7 +117,7 @@ nowayout: Watchdog cannot be stopped once started ...@@ -117,7 +117,7 @@ nowayout: Watchdog cannot be stopped once started
------------------------------------------------- -------------------------------------------------
iTCO_wdt: iTCO_wdt:
heartbeat: Watchdog heartbeat in seconds. heartbeat: Watchdog heartbeat in seconds.
(5<=heartbeat<=74 (TCO v1) or 1226 (TCO v2), default=30) (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=30)
nowayout: Watchdog cannot be stopped once started nowayout: Watchdog cannot be stopped once started
(default=kernel config parameter) (default=kernel config parameter)
------------------------------------------------- -------------------------------------------------
......
...@@ -306,15 +306,16 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev) ...@@ -306,15 +306,16 @@ static int iTCO_wdt_ping(struct watchdog_device *wd_dev)
iTCO_vendor_pre_keepalive(p->smi_res, wd_dev->timeout); iTCO_vendor_pre_keepalive(p->smi_res, wd_dev->timeout);
/* Reset the timeout status bit so that the timer
* needs to count down twice again before rebooting */
outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */
/* Reload the timer by writing to the TCO Timer Counter register */ /* Reload the timer by writing to the TCO Timer Counter register */
if (p->iTCO_version >= 2) if (p->iTCO_version >= 2) {
outw(0x01, TCO_RLD(p)); outw(0x01, TCO_RLD(p));
else if (p->iTCO_version == 1) } else if (p->iTCO_version == 1) {
/* Reset the timeout status bit so that the timer
* needs to count down twice again before rebooting */
outw(0x0008, TCO1_STS(p)); /* write 1 to clear bit */
outb(0x01, TCO_RLD(p)); outb(0x01, TCO_RLD(p));
}
spin_unlock(&p->io_lock); spin_unlock(&p->io_lock);
return 0; return 0;
...@@ -327,8 +328,11 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t) ...@@ -327,8 +328,11 @@ static int iTCO_wdt_set_timeout(struct watchdog_device *wd_dev, unsigned int t)
unsigned char val8; unsigned char val8;
unsigned int tmrval; unsigned int tmrval;
/* The timer counts down twice before rebooting */ tmrval = seconds_to_ticks(p, t);
tmrval = seconds_to_ticks(p, t) / 2;
/* For TCO v1 the timer counts down twice before rebooting */
if (p->iTCO_version == 1)
tmrval /= 2;
/* from the specs: */ /* from the specs: */
/* "Values of 0h-3h are ignored and should not be attempted" */ /* "Values of 0h-3h are ignored and should not be attempted" */
...@@ -381,8 +385,6 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev) ...@@ -381,8 +385,6 @@ static unsigned int iTCO_wdt_get_timeleft(struct watchdog_device *wd_dev)
spin_lock(&p->io_lock); spin_lock(&p->io_lock);
val16 = inw(TCO_RLD(p)); val16 = inw(TCO_RLD(p));
val16 &= 0x3ff; val16 &= 0x3ff;
if (!(inw(TCO1_STS(p)) & 0x0008))
val16 += (inw(TCOv2_TMR(p)) & 0x3ff);
spin_unlock(&p->io_lock); spin_unlock(&p->io_lock);
time_left = ticks_to_seconds(p, val16); time_left = ticks_to_seconds(p, val16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment