For watchdog_ping_work is not freezable so that it maybe scheduled before
imx2_wdt_resume where watchdog clock is on, hence, kernel will hang in
imx2_wdt_ping with clock disabled, and then watchdog reset happen.
Prevent the above case by clearing WDOG_HW_RUNNING before suspend, and
restore it with ping in imx2_wdt_resume.
Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Jacky Bai <ping.bai@nxp.com>
*/
__imx2_wdt_set_timeout(wdog, IMX2_WDT_MAX_TIME);
imx2_wdt_ping(wdog);
+
+ /*
+ * clear WDOG_HW_RUNNING to prevent watchdog_ping_work running
+ * before imx2_wdt_resume where clock enabled, otherwise kernel
+ * will hang and watchdog reset happen then.
+ */
+ clear_bit(WDOG_HW_RUNNING, &wdog->status);
}
clk_disable_unprepare(wdev->clk);
if (imx2_wdt_is_running(wdev)) {
imx2_wdt_set_timeout(wdog, wdog->timeout);
imx2_wdt_ping(wdog);
+ set_bit(WDOG_HW_RUNNING, &wdog->status);
}
return 0;