powerpc/powernv: Add explicit fast-reboot support
authorOliver O'Halloran <oohall@gmail.com>
Mon, 17 Feb 2020 02:48:33 +0000 (13:48 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 4 Mar 2020 11:44:27 +0000 (22:44 +1100)
Add a way to manually invoke a fast-reboot rather than setting the NVRAM
flag. The idea is to allow userspace to invoke a fast-reboot using the
optional string argument to the reboot() system call, or using the xmon
zr command so we don't need to leave around a persistent changes on
a system to use the feature.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20200217024833.30580-2-oohall@gmail.com
arch/powerpc/include/asm/opal-api.h
arch/powerpc/platforms/powernv/setup.c

index c1f25a760eb13b4a29fe6e1c7f22b6c0eb7907e4..1dffa3cb16bacfe5786db2b57cf0c0b7ca044cf9 100644 (file)
@@ -1067,6 +1067,7 @@ enum {
        OPAL_REBOOT_PLATFORM_ERROR      = 1,
        OPAL_REBOOT_FULL_IPL            = 2,
        OPAL_REBOOT_MPIPL               = 3,
+       OPAL_REBOOT_FAST                = 4,
 };
 
 /* Argument to OPAL_PCI_TCE_KILL */
index a8fe630cf7cc3bbd96a24f81761e9e4fc02ed0fe..3bc188da82ba746ad74b1c6323d7e093ef7bb25e 100644 (file)
@@ -237,6 +237,8 @@ static void  __noreturn pnv_restart(char *cmd)
                        rc = opal_cec_reboot2(OPAL_REBOOT_MPIPL, NULL);
                else if (strcmp(cmd, "error") == 0)
                        rc = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR, NULL);
+               else if (strcmp(cmd, "fast") == 0)
+                       rc = opal_cec_reboot2(OPAL_REBOOT_FAST, NULL);
                else
                        rc = OPAL_UNSUPPORTED;