watchdog: imx_sc_wdt: Fix reboot on crash
Subsystems (3)
Fabio Estevam
reviewerPATCH 1/1 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.
--- drivers/watchdog/imx_sc_wdt.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/watchdog/imx_sc_wdt.c +5 -0
@@ -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);
Signature · 1 line
2.17.1
Quoted 8 lines · Fabio Estevam
Currently when running the
samples/watchdog/watchdog-simple.capplication and forcing a kernel crash by doing:# ./watchdog-simple & # echo c > /proc/sysrq-triggerThe system does not reboot as expected.
Quoted 7 lines
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]>
Quoted 21 lines
--- drivers/watchdog/imx_sc_wdt.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/watchdog/imx_sc_wdt.c +5
-0@@ -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);
Breno Matheus Lima
Tested-by Breno LimaHi Fabio,
Em dom., 12 de abr. de 2020 às 20:17, Guenter Roeck <[email protected]> escreveu:
Quoted 13 lines · Fabio Estevam
Quoted 11 lines
Currently when running the
samples/watchdog/watchdog-simple.capplication and forcing a kernel crash by doing:# ./watchdog-simple & # echo c > /proc/sysrq-triggerThe 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.
Quoted 6 lines
Quoted 4 lines
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]>
Thanks for the fix.