Skip to content

Commit ea104a9

Browse files
mwalleWim Van Sebroeck
authored andcommitted
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: 6c5c0d4 ("watchdog: sp805: add restart handler") Signed-off-by: Michael Walle <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 2d63908 commit ea104a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/watchdog/sp805_wdt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,14 @@ wdt_restart(struct watchdog_device *wdd, unsigned long mode, void *cmd)
137137
{
138138
struct sp805_wdt *wdt = watchdog_get_drvdata(wdd);
139139

140+
writel_relaxed(UNLOCK, wdt->base + WDTLOCK);
140141
writel_relaxed(0, wdt->base + WDTCONTROL);
141142
writel_relaxed(0, wdt->base + WDTLOAD);
142143
writel_relaxed(INT_ENABLE | RESET_ENABLE, wdt->base + WDTCONTROL);
143144

145+
/* Flush posted writes. */
146+
readl_relaxed(wdt->base + WDTLOCK);
147+
144148
return 0;
145149
}
146150

0 commit comments

Comments
 (0)