Skip to content

Commit

Permalink
core: always flush console before stopping
Browse files Browse the repository at this point in the history
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@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
  • Loading branch information
npiggin authored and stewartsmith committed Jul 4, 2018
1 parent 7a3f307 commit e21159b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions core/fast-reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <skiboot.h>
#include <cpu.h>
#include <console.h>
#include <fsp.h>
#include <psi.h>
#include <opal.h>
Expand Down Expand Up @@ -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 (;;)
;
Expand Down
5 changes: 3 additions & 2 deletions core/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit e21159b

Please sign in to comment.