[Skiboot] [PATCH] core: always flush console before stopping

Nicholas Piggin npiggin at gmail.com
Tue Jul 3 19:20:57 AEST 2018


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 <npiggin at gmail.com>
---
 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 8234799b..56819751 100644
--- a/core/fast-reboot.c
+++ b/core/fast-reboot.c
@@ -16,6 +16,7 @@
 
 #include <skiboot.h>
 #include <cpu.h>
+#include <console.h>
 #include <fsp.h>
 #include <psi.h>
 #include <opal.h>
@@ -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 3282227c..b32cbf5c 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");
-- 
2.17.0



More information about the Skiboot mailing list