watchdog: introduce watchdog_dev_suspend/resume
authorGrzegorz Jaszczyk <grzegorz.jaszczyk@linaro.org>
Fri, 18 Jun 2021 19:50:32 +0000 (21:50 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Sun, 22 Aug 2021 08:28:08 +0000 (10:28 +0200)
commit60bcd91aafd22ef62cef9ae2037fa2e1d4da2fb3
tree918b076b7d7ab529aa5f26f101864a6505ad4802
parentc7b178dae139f8857edc50888cfbf251cd974a38
watchdog: introduce watchdog_dev_suspend/resume

The watchdog drivers often disable wdog clock during suspend and then
enable it again during resume. Nevertheless the ping worker is still
running and can issue low-level ping while the wdog clock is disabled
causing the system hang. To prevent such condition register pm notifier
in the watchdog core which will call watchdog_dev_suspend/resume and
actually cancel ping worker during suspend and restore it back, if
needed, during resume.

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-2-grzegorz.jaszczyk@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/watchdog_core.c
drivers/watchdog/watchdog_dev.c
include/linux/watchdog.h