]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
watchdog: imx_sc_wdt: Fix reboot on crash
authorFabio Estevam <festevam@gmail.com>
Sun, 12 Apr 2020 23:01:22 +0000 (20:01 -0300)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
BugLink: https://bugs.launchpad.net/bugs/1884089
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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/watchdog/imx_sc_wdt.c

index 8ed89f032ebf29058c6f13ee0b9fb46a31a8588c..e0e62149a6f4862f0bf524b0b87058d4d637c84a 100644 (file)
@@ -177,6 +177,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);