summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2024-02-05 12:52:26 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2024-02-08 08:10:40 +0100
commitddf0d5cf35aa5e5e13a3e3a09ea5eea997dcbbd8 (patch)
tree8aa21b67f02ff39420ceb5fd784948e81516eb45
parent56a38966bb30f2cbe9a10a7192847f54dfbc2471 (diff)
downloadbarebox-ddf0d5cf35aa.tar.gz
barebox-ddf0d5cf35aa.tar.xz
watchdog: restart handler: hang when watchdog cannot restart the machine
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(). Link: https://lore.barebox.org/20240205115226.2432028-1-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/watchdog/wd_core.c4
1 files changed, 3 insertions, 1 deletions
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 = {