summaryrefslogtreecommitdiff
path: root/lib/panic.c
diff options
context:
space:
mode:
authorTony Dinh <mibodhi@gmail.com>2023-03-14 17:24:26 -0700
committerTom Rini <trini@konsulko.com>2023-03-22 12:51:08 -0400
commitc5f4cdb8eb60cbfc71b356204245a046c74a30c1 (patch)
tree5405a399cb6f30e167e096766d75a378f99f30f3 /lib/panic.c
parent45156edb168328602e494a00c37e2c4876087e0f (diff)
console: Use flush() before panic and reset
To make sure the panic and the reset messages will go out, console flush() should be used. Sleep periods do not work in early u-boot phase when timer driver is not initialized yet. Reference: https://lists.denx.de/pipermail/u-boot/2023-March/512233.html Signed-off-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'lib/panic.c')
-rw-r--r--lib/panic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/panic.c b/lib/panic.c
index 58382ac4f4..66ae17f3df 100644
--- a/lib/panic.c
+++ b/lib/panic.c
@@ -15,6 +15,7 @@
#include <command.h>
#endif
#include <linux/delay.h>
+#include <stdio.h>
static void panic_finish(void) __attribute__ ((noreturn));
@@ -24,7 +25,8 @@ static void panic_finish(void)
#if defined(CONFIG_PANIC_HANG)
hang();
#else
- udelay(100000); /* allow messages to go out */
+ flush(); /* flush the panic message before reset */
+
do_reset(NULL, 0, 0, NULL);
#endif
while (1)