diff options
author | Fabio Estevam <festevam@gmail.com> | 2020-04-12 20:01:22 -0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-17 16:42:51 +0200 |
commit | bb8ab2343740a70d2982929e9367b6dfe411ac0c (patch) | |
tree | 6f604243f69bdc22996e34bf9ebf2d5e19c595cf | |
parent | acba9bd0d0a9757f148e72f84d38d4cd3b7e390d (diff) | |
download | linux-stable-bb8ab2343740a70d2982929e9367b6dfe411ac0c.tar.gz linux-stable-bb8ab2343740a70d2982929e9367b6dfe411ac0c.tar.bz2 linux-stable-bb8ab2343740a70d2982929e9367b6dfe411ac0c.zip |
watchdog: imx_sc_wdt: Fix reboot on crash
commit e56d48e92b1017b6a8dbe64923a889283733fd96 upstream.
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: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support")
Reported-by: Breno Lima <breno.lima@nxp.com>
Signed-off-by: Fabio Estevam <festevam@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Breno Lima <breno.lima@nxp.com>
Link: https://lore.kernel.org/r/20200412230122.5601-1-festevam@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/watchdog/imx_sc_wdt.c | 5 |
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); |