Commit e56d48e9 authored by Fabio Estevam's avatar Fabio Estevam Committed by Wim Van Sebroeck
Browse files

watchdog: imx_sc_wdt: Fix reboot on crash



Currently when running the samples/watchdog/watchdog-simple.c
application and forcing a kernel crash by doing:

# ./watchdog-simple &
# echo c > /proc/sysrq-trigger

The system does not reboot as expected.

Fix it by calling imx_sc_wdt_set_timeout() to configure the i.MX8QXP
watchdog with a proper timeout.

Cc: <stable@vger.kernel.org>
Fixes: 986857ac ("watchdog: imx_sc: Add i.MX system controller watchdog support")
Reported-by: default avatarBreno Lima <breno.lima@nxp.com>
Signed-off-by: default avatarFabio Estevam <festevam@gmail.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Tested-by: default avatarBreno Lima <breno.lima@nxp.com>
Link: https://lore.kernel.org/r/20200412230122.5601-1-festevam@gmail.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 0f0dbd9b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -175,6 +175,11 @@ static int imx_sc_wdt_probe(struct platform_device *pdev)
	wdog->timeout = DEFAULT_TIMEOUT;

	watchdog_init_timeout(wdog, 0, dev);

	ret = imx_sc_wdt_set_timeout(wdog, wdog->timeout);
	if (ret)
		return ret;

	watchdog_stop_on_reboot(wdog);
	watchdog_stop_on_unregister(wdog);