Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: sama5d4: readout initial state

Readout the AT91_WDT_MR bit at probe so that it becomes possible to get the
pre-userspace handler working.

Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230819084726.11037-1-othacehe@gnu.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

authored by

Mathieu Othacehe and committed by
Wim Van Sebroeck
266da53c cf38e769

+7
+7
drivers/watchdog/sama5d4_wdt.c
··· 254 254 struct sama5d4_wdt *wdt; 255 255 void __iomem *regs; 256 256 u32 irq = 0; 257 + u32 reg; 257 258 int ret; 258 259 259 260 wdt = devm_kzalloc(dev, sizeof(*wdt), GFP_KERNEL); ··· 304 303 } 305 304 306 305 watchdog_init_timeout(wdd, wdt_timeout, dev); 306 + 307 + reg = wdt_read(wdt, AT91_WDT_MR); 308 + if (!(reg & AT91_WDT_WDDIS)) { 309 + wdt->mr &= ~AT91_WDT_WDDIS; 310 + set_bit(WDOG_HW_RUNNING, &wdd->status); 311 + } 307 312 308 313 ret = sama5d4_wdt_init(wdt); 309 314 if (ret)