Skip to content

Commit

Permalink
watchdog: sp805: Don't write 0 to the load value register.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nick Bowler authored and Wim Van Sebroeck committed Jul 26, 2011
1 parent f5a427e commit da3e515
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/watchdog/sp805_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ static void wdt_disable(void)

writel(UNLOCK, wdt->base + WDTLOCK);
writel(0, wdt->base + WDTCONTROL);
writel(0, wdt->base + WDTLOAD);
writel(LOCK, wdt->base + WDTLOCK);

spin_unlock(&wdt->lock);
Expand Down

0 comments on commit da3e515

Please sign in to comment.