]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
powerpc/powernv: Allow manually invoking special reboots
authorOliver O'Halloran <oohall@gmail.com>
Fri, 1 Nov 2019 08:55:22 +0000 (19:55 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 23 Jan 2020 10:31:21 +0000 (21:31 +1100)
OPAL provides several different kinds of reboot for the kernel to use,
namely forcing a full reboot, platform error reboot and MPIPL. Right now
triggering the alternative resets requires some ad-hoc method such as
triggering a kernel crash and hoping the stars align. It's sometimes handy
to be able to trigger one of these resets directly, so add a way to do
that.

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

index 83498604d322be152a04533af3a049752f76cc0b..11fdae81b5ddc5f4b5bd798dbeba595ef8cc1c87 100644 (file)
@@ -233,6 +233,10 @@ static void  __noreturn pnv_restart(char *cmd)
                        rc = opal_cec_reboot();
                else if (strcmp(cmd, "full") == 0)
                        rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL);
+               else if (strcmp(cmd, "mpipl") == 0)
+                       rc = opal_cec_reboot2(OPAL_REBOOT_MPIPL, NULL);
+               else if (strcmp(cmd, "error") == 0)
+                       rc = opal_cec_reboot2(OPAL_REBOOT_PLATFORM_ERROR, NULL);
                else
                        rc = OPAL_UNSUPPORTED;