From e21159bf9683a3d61478c4929f6706aa0efa35af Mon Sep 17 00:00:00 2001 From: Nicholas Piggin Date: Tue, 3 Jul 2018 19:20:57 +1000 Subject: core: always flush console before stopping This catches a few cases (e.g., fast reboot failure messages) that don't always make it to the console before the machine is rebooted. Signed-off-by: Nicholas Piggin Signed-off-by: Stewart Smith --- core/fast-reboot.c | 3 +++ core/platform.c | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/fast-reboot.c b/core/fast-reboot.c index 8234799..5681975 100644 --- a/core/fast-reboot.c +++ b/core/fast-reboot.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -175,6 +176,8 @@ void fast_reboot(void) /* This resets our quiesce state ready to enter the new kernel. */ opal_quiesce(QUIESCE_RESUME_FAST_REBOOT, -1); + console_complete_flush(); + asm volatile("ba 0x100\n\t" : : : "memory"); for (;;) ; diff --git a/core/platform.c b/core/platform.c index 3282227..b32cbf5 100644 --- a/core/platform.c +++ b/core/platform.c @@ -58,12 +58,12 @@ static int64_t opal_cec_reboot(void) opal_quiesce(QUIESCE_HOLD, -1); - console_complete_flush(); - /* Try fast-reset unless explicitly disabled */ if (!nvram_query_eq("fast-reset","0")) fast_reboot(); + console_complete_flush(); + if (platform.cec_reboot) return platform.cec_reboot(); @@ -97,6 +97,7 @@ static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag) prerror("OPAL: failed to log an error\n"); } disable_fast_reboot("Reboot due to Platform Error"); + console_complete_flush(); return xscom_trigger_xstop(); case OPAL_REBOOT_FULL_IPL: disable_fast_reboot("full IPL reboot requested"); -- cgit v1.1