Skip to content

Commit

Permalink
core/fast-reboot: print the fast reboot disable reason
Browse files Browse the repository at this point in the history
Once things start to go wrong, disable_fast_reboot can be called a
number of times, so make the first reason sticky, and also print it
to the console at disable time. This helps with making sense of
fast reboot disables.

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 Sep 19, 2018
1 parent aeb3669 commit 129e440
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/fast-reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ static const char *fast_reboot_disabled = NULL;

void disable_fast_reboot(const char *reason)
{
if (fast_reboot_disabled)
return;

prlog(PR_NOTICE, "RESET: Fast reboot disabled: %s\n", reason);
fast_reboot_disabled = reason;
}

Expand All @@ -92,8 +96,7 @@ void add_fast_reboot_dt_entries(void)
static bool fast_reboot_sanity_check(void)
{
if (!mem_check_all()) {
prlog(PR_NOTICE, "REST: Fast reboot failed due to inconsistent "
"firmware data\n");
disable_fast_reboot("Inconsistent firmware data");
return false;
}

Expand Down Expand Up @@ -121,13 +124,12 @@ void fast_reboot(void)
* Ensure all other CPUs have left OPAL calls.
*/
if (!opal_quiesce(QUIESCE_HOLD, -1)) {
prlog(PR_NOTICE, "RESET: Fast reboot disabled because OPAL "
"quiesce timed out\n");
disable_fast_reboot("OPAL quiesce timeout");
return;
}

if (fast_reboot_disabled) {
prlog(PR_DEBUG, "RESET: Fast reboot disabled because %s\n",
prlog(PR_NOTICE, "RESET: Fast reboot disabled: %s\n",
fast_reboot_disabled);
opal_quiesce(QUIESCE_RESUME, -1);
return;
Expand Down

0 comments on commit 129e440

Please sign in to comment.