[PATCH] watchdog: restart handler: hang when watchdog cannot restart the machine

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

 



The __builtin_unreachable() in watchdog_restart_handle() is bogus,
because when the watchdog doesn't work we will run into
__builtin_unreachable() and behaviour is undefined. Drop the call
to __builtin_unreachable(), print a big fat warning and hang() the
machine which makes sure we don't return from watchdog_restart_handle().

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/watchdog/wd_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/watchdog/wd_core.c b/drivers/watchdog/wd_core.c
index 89e4f1d1ea..f39a8f4522 100644
--- a/drivers/watchdog/wd_core.c
+++ b/drivers/watchdog/wd_core.c
@@ -179,7 +179,9 @@ static void __noreturn watchdog_restart_handle(struct restart_handler *this)
 
 	BUG_ON(ret);
 	mdelay(2000);
-	__builtin_unreachable();
+
+	pr_emerg("Watchdog failed to reset the machine\n");
+	hang();
 }
 
 static struct restart_handler restart_handler = {
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux