mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-26 15:28:50 +00:00
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>
This commit is contained in:
parent
45156edb16
commit
c5f4cdb8eb
2 changed files with 5 additions and 3 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <cpu_func.h>
|
#include <cpu_func.h>
|
||||||
#include <irq_func.h>
|
#include <irq_func.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
__weak void reset_misc(void)
|
__weak void reset_misc(void)
|
||||||
{
|
{
|
||||||
|
@ -33,8 +34,7 @@ __weak void reset_misc(void)
|
||||||
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
puts ("resetting ...\n");
|
puts ("resetting ...\n");
|
||||||
|
flush();
|
||||||
mdelay(50); /* wait 50 ms */
|
|
||||||
|
|
||||||
disable_interrupts();
|
disable_interrupts();
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include <command.h>
|
#include <command.h>
|
||||||
#endif
|
#endif
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
static void panic_finish(void) __attribute__ ((noreturn));
|
static void panic_finish(void) __attribute__ ((noreturn));
|
||||||
|
|
||||||
|
@ -24,7 +25,8 @@ static void panic_finish(void)
|
||||||
#if defined(CONFIG_PANIC_HANG)
|
#if defined(CONFIG_PANIC_HANG)
|
||||||
hang();
|
hang();
|
||||||
#else
|
#else
|
||||||
udelay(100000); /* allow messages to go out */
|
flush(); /* flush the panic message before reset */
|
||||||
|
|
||||||
do_reset(NULL, 0, 0, NULL);
|
do_reset(NULL, 0, 0, NULL);
|
||||||
#endif
|
#endif
|
||||||
while (1)
|
while (1)
|
||||||
|
|
Loading…
Add table
Reference in a new issue