diff mbox series

[1/2] core/platform: Add an explicit fast-reboot type

Message ID 20200217010224.26285-1-oohall@gmail.com
State Accepted
Headers show
Series [1/2] core/platform: Add an explicit fast-reboot type | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (53944d45087bd78bf7f9494a54e464c74322a83a)
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present

Commit Message

Oliver O'Halloran Feb. 17, 2020, 1:02 a.m. UTC
The OPAL_CEC_REBOOT2 OPAL call allows a specific type of reboot to be
requested. We can use this to allow the OS to request a fast-reboot
explicitly rather than relying on nvram hacks to change the default
behaviour.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 core/platform.c    | 4 ++++
 include/opal-api.h | 1 +
 2 files changed, 5 insertions(+)

Comments

Oliver O'Halloran March 6, 2020, 3:29 a.m. UTC | #1
On Mon, Feb 17, 2020 at 12:02 PM Oliver O'Halloran <oohall@gmail.com> wrote:
>
> The OPAL_CEC_REBOOT2 OPAL call allows a specific type of reboot to be
> requested. We can use this to allow the OS to request a fast-reboot
> explicitly rather than relying on nvram hacks to change the default
> behaviour.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Series merged as of 10bbcd0788bc73ec675eb06e6c84faab5aab4461
diff mbox series

Patch

diff --git a/core/platform.c b/core/platform.c
index 97bc7cb6fa1e..99cf5c985399 100644
--- a/core/platform.c
+++ b/core/platform.c
@@ -116,6 +116,10 @@  static int64_t opal_cec_reboot2(uint32_t reboot_type, char *diag)
 			opal_cec_reboot();
 		for (;;);
 		break;
+	case OPAL_REBOOT_FAST:
+		prlog(PR_NOTICE, "Reboot: Fast reboot requested by OS\n");
+		fast_reboot();
+		break;
 	default:
 		prlog(PR_NOTICE, "OPAL: Unsupported reboot request %d\n", reboot_type);
 		return OPAL_UNSUPPORTED;
diff --git a/include/opal-api.h b/include/opal-api.h
index 5b07dea1321b..e425d79f209a 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -1135,6 +1135,7 @@  enum {
 	OPAL_REBOOT_PLATFORM_ERROR,
 	OPAL_REBOOT_FULL_IPL,
 	OPAL_REBOOT_MPIPL,
+	OPAL_REBOOT_FAST,
 };
 
 /* Argument to OPAL_PCI_TCE_KILL */