linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] watchdog: imx7ulp: Fix reboot hang
@ 2019-10-29 17:40 Fabio Estevam
  2019-10-29 17:40 ` [PATCH 2/5] watchdog: imx7ulp: Pass the wdog instance inimx7ulp_wdt_enable() Fabio Estevam
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Fabio Estevam @ 2019-10-29 17:40 UTC (permalink / raw)
  To: linux
  Cc: wim, linux-watchdog, Anson.Huang, shawnguo, linux-imx, kernel,
	Fabio Estevam

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: 41b630f41bf7 ("watchdog: Add i.MX7ULP watchdog support")
Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/watchdog/imx7ulp_wdt.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/watchdog/imx7ulp_wdt.c b/drivers/watchdog/imx7ulp_wdt.c
index 5ce51026989a..ba5d535a6db2 100644
--- a/drivers/watchdog/imx7ulp_wdt.c
+++ b/drivers/watchdog/imx7ulp_wdt.c
@@ -106,12 +106,28 @@ static int imx7ulp_wdt_set_timeout(struct watchdog_device *wdog,
 	return 0;
 }
 
+static int imx7ulp_wdt_restart(struct watchdog_device *wdog,
+			       unsigned long action, void *data)
+{
+	struct imx7ulp_wdt_device *wdt = watchdog_get_drvdata(wdog);
+
+	imx7ulp_wdt_enable(wdt->base, true);
+	imx7ulp_wdt_set_timeout(&wdt->wdd, 1);
+
+	/* wait for wdog to fire */
+	while (true)
+		;
+
+	return NOTIFY_DONE;
+}
+
 static const struct watchdog_ops imx7ulp_wdt_ops = {
 	.owner = THIS_MODULE,
 	.start = imx7ulp_wdt_start,
 	.stop  = imx7ulp_wdt_stop,
 	.ping  = imx7ulp_wdt_ping,
 	.set_timeout = imx7ulp_wdt_set_timeout,
+	.restart = imx7ulp_wdt_restart,
 };
 
 static const struct watchdog_info imx7ulp_wdt_info = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-11-08 14:39 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-29 17:40 [PATCH 1/5] watchdog: imx7ulp: Fix reboot hang Fabio Estevam
2019-10-29 17:40 ` [PATCH 2/5] watchdog: imx7ulp: Pass the wdog instance inimx7ulp_wdt_enable() Fabio Estevam
2019-11-02 15:37   ` Guenter Roeck
2019-10-29 17:40 ` [PATCH 3/5] watchdog: imx7ulp: Remove unused structure member Fabio Estevam
2019-11-02 15:39   ` Guenter Roeck
2019-10-29 17:40 ` [PATCH 4/5] watchdog: imx7ulp: Remove inline annotations Fabio Estevam
2019-11-02 15:39   ` Guenter Roeck
2019-10-29 17:40 ` [PATCH 5/5] watchdog: imx7ulp: Use definitions instead of magic values Fabio Estevam
2019-11-02 15:41   ` Guenter Roeck
2019-11-02 15:36 ` [PATCH 1/5] watchdog: imx7ulp: Fix reboot hang Guenter Roeck
2019-11-04 13:45   ` Fabio Estevam
2019-11-04 14:06     ` Guenter Roeck
2019-11-07 17:46       ` Fabio Estevam
2019-11-08 14:39         ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).