Skip to content

Commit b771d14

Browse files
saschahauerWim Van Sebroeck
authored andcommitted
watchdog: imx7ulp_wdt: keep already running watchdog enabled
When the bootloader enabled the watchdog before Kernel started then keep it enabled during initialization. Otherwise the time between the watchdog probing and the userspace taking over the watchdog won't be covered by the watchdog. When keeping the watchdog enabled inform the Kernel about this by setting the WDOG_HW_RUNNING so that the periodic watchdog feeder is started when desired. Signed-off-by: Sascha Hauer <[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 9dca7a0 commit b771d14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/watchdog/imx7ulp_wdt.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ static int imx7ulp_wdt_init(struct imx7ulp_wdt_device *wdt, unsigned int timeout
290290
if (wdt->ext_reset)
291291
val |= WDOG_CS_INT_EN;
292292

293+
if (readl(wdt->base + WDOG_CS) & WDOG_CS_EN) {
294+
set_bit(WDOG_HW_RUNNING, &wdt->wdd.status);
295+
val |= WDOG_CS_EN;
296+
}
297+
293298
do {
294299
ret = _imx7ulp_wdt_init(wdt, timeout, val);
295300
toval = readl(wdt->base + WDOG_TOVAL);

0 commit comments

Comments
 (0)