Skip to content

Commit 6083ab7

Browse files
fabioestevamWim Van Sebroeck
authored andcommitted
watchdog: imx7ulp: Fix reboot hang
The following hang is observed when a 'reboot' command is issued: # reboot # Stopping network: OK Stopping klogd: OK Stopping syslogd: OK umount: devtmpfs busy - remounted read-only [ 8.612079] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null) The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system reboot [ 10.694753] reboot: Restarting system [ 11.699008] Reboot failed -- System halted Fix this problem by adding a .restart ops member. Fixes: 41b630f ("watchdog: Add i.MX7ULP watchdog support") Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Guenter Roeck <[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]>
1 parent bc44fa7 commit 6083ab7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/watchdog/imx7ulp_wdt.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,28 @@ static int imx7ulp_wdt_set_timeout(struct watchdog_device *wdog,
107107
return 0;
108108
}
109109

110+
static int imx7ulp_wdt_restart(struct watchdog_device *wdog,
111+
unsigned long action, void *data)
112+
{
113+
struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog);
114+
115+
imx7ulp_wdt_enable(wdt->base, true);
116+
imx7ulp_wdt_set_timeout(&wdt->wdd, 1);
117+
118+
/* wait for wdog to fire */
119+
while (true)
120+
;
121+
122+
return NOTIFY_DONE;
123+
}
124+
110125
static const struct watchdog_ops imx7ulp_wdt_ops = {
111126
.owner = THIS_MODULE,
112127
.start = imx7ulp_wdt_start,
113128
.stop = imx7ulp_wdt_stop,
114129
.ping = imx7ulp_wdt_ping,
115130
.set_timeout = imx7ulp_wdt_set_timeout,
131+
.restart = imx7ulp_wdt_restart,
116132
};
117133

118134
static const struct watchdog_info imx7ulp_wdt_info = {

0 commit comments

Comments
 (0)