aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Estevam <[email protected]>2020-04-12 20:01:22 -0300
committerWim Van Sebroeck <[email protected]>2020-05-25 08:55:40 +0200
commite56d48e92b1017b6a8dbe64923a889283733fd96 (patch)
treedcbaf1098236ecacf4a24f310bfe13881b986848
parent0f0dbd9b36bbca6ffc0852d7859edc0ac8f11727 (diff)
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: <[email protected]> Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support") Reported-by: Breno Lima <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Tested-by: Breno Lima <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/imx_sc_wdt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c
index 60a32469f7de..e9ee22a7cb45 100644
--- a/drivers/watchdog/imx_sc_wdt.c
+++ b/drivers/watchdog/imx_sc_wdt.c
@@ -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);