[PATCH] powerpc/powernv: Make possible for user to force a full ipl cec reboot
Andrew Donnellan
andrew.donnellan at au1.ibm.com
Mon Sep 3 13:10:55 AEST 2018
On 01/09/18 18:17, Vaibhav Jain wrote:
> Ever since fast reboot is enabled by default in opal,
> opal_cec_reboot() will use fast-reset instead of full IPL to perform
> system reboot. This leaves the user with no direct way to force a full
> IPL reboot except changing an nvram setting that persistently disables
> fast-reset for all subsequent reboots.
>
> This patch provides a more direct way for the user to force a one-shot
> full IPL reboot by passing the command line argument 'full' to the
> reboot command. So the user will be able to tweak the reboot behavior
> via:
>
> $ sudo reboot full # Force a full ipl reboot skipping fast-reset
>
> or
> $ sudo reboot # default reboot path (usually fast-reset)
>
> The reboot command passes the un-parsed command argument to the kernel
> via the 'Reboot' syscall which is then passed on to the arch function
> pnv_restart(). The patch updates pnv_restart() to handle this cmd-arg
> and issues opal_cec_reboot2 with OPAL_REBOOT_FULL_IPL to force a full
> IPL reset.
>
> Signed-off-by: Vaibhav Jain <vaibhav at linux.ibm.com>
Oh good, someone else has finally picked this up and sent a kernel
patch, I did the skiboot half and then neglected to make it useful (I
sent an RFC at https://patchwork.ozlabs.org/patch/697604/ but never
followed up on it... this approach seems more usable, I think).
When you say "the reboot command" - is this behaviour of passing the
argument common to all the important init systems/reboot utils? What's
the correct systemd way to do it?
> while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
> - rc = opal_cec_reboot();
> +
> + /* See if we need to do a full IPL reboot */
> + if (cmd && strcmp(cmd, "full") == 0)
> + rc = opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL);
You might want to check for OPAL_UNSUPPORTED here just in case we're
running on ancient firmware.
> + else
> + rc = opal_cec_reboot();
> +
> if (rc == OPAL_BUSY_EVENT)
> opal_poll_events(NULL);
> else
>
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com IBM Australia Limited
More information about the Linuxppc-dev
mailing list