From: nbowler@elliptictech.com (Nick Bowler)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] watchdog: sp805: Don't write 0 to the load value register.
Date: Fri, 15 Jul 2011 11:04:01 -0400 [thread overview]
Message-ID: <1310742242-14647-3-git-send-email-nbowler@elliptictech.com> (raw)
In-Reply-To: <1310742242-14647-1-git-send-email-nbowler@elliptictech.com>
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>
---
drivers/watchdog/sp805_wdt.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 0d80e08..c1e099a 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -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);
--
1.7.3.4
next prev parent reply other threads:[~2011-07-15 15:04 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 15:03 [PATCH 0/3] SP805 updates for Versatile Express Nick Bowler
2011-07-15 15:04 ` [PATCH 1/3] ARM: vexpress: Add clock definition for the SP805 Nick Bowler
2011-07-15 15:04 ` Nick Bowler [this message]
2011-07-15 15:04 ` [PATCH 3/3] watchdog: sp805: Flush posted writes in enable/disable Nick Bowler
2011-07-15 20:59 ` [PATCH 0/3] SP805 updates for Versatile Express Wim Van Sebroeck
2011-07-18 9:44 ` Russell King - ARM Linux
2011-07-19 13:15 ` Nick Bowler
2011-07-22 18:31 ` Wim Van Sebroeck
2011-07-22 19:01 ` Nick Bowler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310742242-14647-3-git-send-email-nbowler@elliptictech.com \
--to=nbowler@elliptictech.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).