watchdog: imx2_wdt: avoid to ping before resume back
authorRobin Gong <yibin.gong@nxp.com>
Fri, 14 May 2021 17:21:15 +0000 (01:21 +0800)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Mon, 21 Jun 2021 06:48:59 +0000 (08:48 +0200)
commite0b101ab01c719a5a81b21ff16bbd33a868f9189
treef52aea1dedf2601d5eaed85b74a64c6823450b2b
parent76215889be9d2cd388207545424bbbe3bf80e1ea
watchdog: imx2_wdt: avoid to ping before resume back

Since watchdog_ping_work is not freezable so that it maybe scheduled before
imx2_wdt_resume where watchdog clock enabled, hence, kernel will hang in
imx2_wdt_ping without clock, and then watchdog reset happen. Add clk_is_on
to prevent the above case by ignoring ping until watchdog driver resume
back indeed.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/1621012875-22667-1-git-send-email-yibin.gong@nxp.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/imx2_wdt.c