aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/sp805_wdt.c
diff options
context:
space:
mode:
authorNick Bowler <nbowler@elliptictech.com>2011-07-15 11:04:01 -0400
committerWim Van Sebroeck <wim@iguana.be>2011-07-26 17:19:43 -0400
commitda3e515024ba32aaf0d524518ce39a8fb77332cd (patch)
tree89d186e442b76d75ae76ed14b321f5f1adaa012a /drivers/watchdog/sp805_wdt.c
parentf5a427eedeead2be82561497a12788bd1f0c07d3 (diff)
watchdog: sp805: Don't write 0 to the load value register.
At least on the Versatile Express' V2M, calling wdt_disable followed by wdt_enable, for instance by running the following sequence: echo V > /dev/watchdog; echo V > /dev/watchdog results in an immediate reset. The wdt_disable function writes 0 to the load register; while the watchdog interrupts are disabled at this point, this special value is defined to trigger an interrupt immediately. It appears that in this instance, the reset happens when the interrupts are subsequently enabled by wdt_enable. Putting in a short delay after writing a new load value in wdt_enable solves the issue, but it seems cleaner to simply never write 0 to the load register at all: according to the hardware docs, writing 0 to the control register suffices to stop the counter, and the write of 0 to the load register is questionable anyway since this register resets to 0xffffffff. Signed-off-by: Nick Bowler <nbowler@elliptictech.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/sp805_wdt.c')
-rw-r--r--drivers/watchdog/sp805_wdt.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 0d80e08b6439..c1e099aa57f3 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -144,7 +144,6 @@ static void wdt_disable(void)
144 144
145 writel(UNLOCK, wdt->base + WDTLOCK); 145 writel(UNLOCK, wdt->base + WDTLOCK);
146 writel(0, wdt->base + WDTCONTROL); 146 writel(0, wdt->base + WDTCONTROL);
147 writel(0, wdt->base + WDTLOAD);
148 writel(LOCK, wdt->base + WDTLOCK); 147 writel(LOCK, wdt->base + WDTLOCK);
149 148
150 spin_unlock(&wdt->lock); 149 spin_unlock(&wdt->lock);