When the watchdog is initialized and triggered before the kernel runs, it must be ensured that the kernel uses a different trigger pattern. Otherwise the watchdog cannot be kicked. Reading the current counter reload trigger pattern from the watchdog hardware during probing makes sure that the trigger pattern is different from the one previously used. Signed-off-by: Jan Sondhauss <jan.sondhauss@xxxxxxxx> --- drivers/watchdog/omap_wdt.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index 74d785b2b478..680a34588425 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c @@ -85,6 +85,13 @@ static void omap_wdt_reload(struct omap_wdt_dev *wdev) /* reloaded WCRR from WLDR */ } +static void omap_wdt_init_trgr_pattern(struct omap_wdt_dev *wdev) +{ + void __iomem *base = wdev->base; + + wdev->wdt_trgr_pattern = readl_relaxed(base + OMAP_WATCHDOG_TGR); +} + static void omap_wdt_enable(struct omap_wdt_dev *wdev) { void __iomem *base = wdev->base; @@ -238,7 +245,6 @@ static int omap_wdt_probe(struct platform_device *pdev) wdev->omap_wdt_users = false; wdev->dev = &pdev->dev; - wdev->wdt_trgr_pattern = 0x1234; mutex_init(&wdev->lock); /* reserve static register mappings */ @@ -253,6 +259,8 @@ static int omap_wdt_probe(struct platform_device *pdev) wdev->wdog.timeout = TIMER_MARGIN_DEFAULT; wdev->wdog.parent = &pdev->dev; + omap_wdt_init_trgr_pattern(wdev); + watchdog_init_timeout(&wdev->wdog, timer_margin, &pdev->dev); watchdog_set_nowayout(&wdev->wdog, nowayout); -- 2.35.1