diff options
author | Sandeep Tripathy <tripathy@broadcom.com> | 2016-01-19 10:14:49 +0100 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2016-01-31 16:52:08 +0100 |
commit | 55e071779c79890f43b75d4472243280e91581de (patch) | |
tree | 8f9859ae3d02b35cd3f27b8e99bcb7252f1a6cb0 /drivers/watchdog | |
parent | watchdog: max63xx: make module's license marker match the header (diff) | |
download | linux-55e071779c79890f43b75d4472243280e91581de.tar.xz linux-55e071779c79890f43b75d4472243280e91581de.zip |
watchdog: sp805: ping fails to abort wdt reset
sp805 wdt asserts interrupt for the first expiry and
reloads the counter. If wdt interrupt is set and count
reaches zero then wdt reset event is generated. To get
wdt reset at 't' timeout the driver loads wdt counter
with 't/2'. A ping before time 't' *should* prevent
wdt reset. Currently if ping is done after 't/2' then
wdt interrupt condition gets set. On the next countdown
of loadval wdt reset event occurs eventhough wdt was
reloaded before the set timeout 't'.
This patch clears the interrupt condition on ping.
Signed-off-by: Sandeep Tripathy <tripathy@broadcom.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/sp805_wdt.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 01d816251302..e7a715e82021 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -139,12 +139,11 @@ static int wdt_config(struct watchdog_device *wdd, bool ping) writel_relaxed(UNLOCK, wdt->base + WDTLOCK); writel_relaxed(wdt->load_val, wdt->base + WDTLOAD); + writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); - if (!ping) { - writel_relaxed(INT_MASK, wdt->base + WDTINTCLR); + if (!ping) writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL); - } writel_relaxed(LOCK, wdt->base + WDTLOCK); |