summaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2020-03-27 17:24:50 +0100
committerWim Van Sebroeck <wim@linux-watchdog.org>2020-04-08 11:18:38 +0200
commitea104a9e4d3e9ebc26fb78dac35585b142ee288b (patch)
tree69dc96625344f1cbd0f6793b5d742e24de2c3ce3 /drivers/watchdog
parent2d63908bdbfbce0d98195b22236ad5105dc6eba2 (diff)
downloadlinux-stable-ea104a9e4d3e9ebc26fb78dac35585b142ee288b.tar.gz
linux-stable-ea104a9e4d3e9ebc26fb78dac35585b142ee288b.tar.bz2
linux-stable-ea104a9e4d3e9ebc26fb78dac35585b142ee288b.zip
watchdog: sp805: fix restart handler
The restart handler is missing two things, first, the registers has to be unlocked and second there is no synchronization for the write_relaxed() calls. This was tested on a custom board with the NXP LS1028A SoC. Fixes: 6c5c0d48b686c ("watchdog: sp805: add restart handler") Signed-off-by: Michael Walle <michael@walle.cc> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Link: https://lore.kernel.org/r/20200327162450.28506-1-michael@walle.cc Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/sp805_wdt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index 53e04926a7b2..190d26e2e75f 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -137,10 +137,14 @@ wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd)
{
struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
+ writel_relaxed(UNLOCK, wdt->base + WDTLOCK);
writel_relaxed(0, wdt->base + WDTCONTROL);
writel_relaxed(0, wdt->base + WDTLOAD);
writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
+ /* Flush posted writes. */
+ readl_relaxed(wdt->base + WDTLOCK);
+
return 0;
}