Skip to content

Commit

Permalink
watchdog: imx2_wdg: notify wdog core to stop ping worker on suspend
Browse files Browse the repository at this point in the history
Suspend routine disables wdog clk. Nevertheless, the watchdog subsystem
is not aware of that and can still try to ping wdog through
watchdog_ping_work. In order to prevent such condition and therefore
prevent from system hang (caused by the wdog register access issued
while the wdog clock is disabled) notify watchdog core that the ping
worker should be canceled during watchdog core suspend and restored
during resume.

Signed-off-by: Michal Koziel <michal.koziel@emlogic.no>
Signed-off-by: Grzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20210618195033.3209598-3-grzegorz.jaszczyk@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
  • Loading branch information
Grzegorz Jaszczyk authored and Wim Van Sebroeck committed Aug 22, 2021
1 parent 60bcd91 commit 14244b7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/watchdog/imx2_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ static int __init imx2_wdt_probe(struct platform_device *pdev)
watchdog_set_nowayout(wdog, nowayout);
watchdog_set_restart_priority(wdog, 128);
watchdog_init_timeout(wdog, timeout, dev);
watchdog_stop_ping_on_suspend(wdog);

if (imx2_wdt_is_running(wdev)) {
imx2_wdt_set_timeout(wdog, wdog->timeout);
Expand Down

0 comments on commit 14244b7

Please sign in to comment.