]> git.karo-electronics.de Git - karo-tx-linux.git/commit
watchdog: sp805: Don't write 0 to the load value register.
authorNick Bowler <nbowler@elliptictech.com>
Fri, 15 Jul 2011 15:04:01 +0000 (11:04 -0400)
committerWim Van Sebroeck <wim@iguana.be>
Fri, 22 Jul 2011 17:10:13 +0000 (17:10 +0000)
commitd2df6e0d1e7947791b2f66eed96d82d5c3429c25
tree0d51a558b48e1453524924cf8562a254426a8e1c
parentd90857a38227b7886c83a1cde1f9ee8e7ac62bd7
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>
drivers/watchdog/sp805_wdt.c