Re: [PATCH] watchdog: imx_sc_wdt: Fix reboot on crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/12/20 4:01 PM, Fabio Estevam wrote:
> 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@xxxxxxxxxxxxxxx>
> Fixes: 986857acbc9a ("watchdog: imx_sc: Add i.MX system controller watchdog support")
> Reported-by: Breno Lima <breno.lima@xxxxxxx>
> Signed-off-by: Fabio Estevam <festevam@xxxxxxxxx>

Reviewed-by: Guenter Roeck <linux@xxxxxxxxxxxx>

> ---
>  drivers/watchdog/imx_sc_wdt.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> 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);
>  
> 




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux