Thread (7 messages) flat view 7 messages, 4 authors, 2018-09-10

Re: [PATCH] powerpc/powernv: Make possible for user to force a full ipl cec reboot

From: Andrew Donnellan <hidden>
Date: 2018-09-03 03:11:07

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.
=20
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:
=20
   $ sudo reboot full	# Force a full ipl reboot skipping fast-reset
=20
   or
   $ sudo reboot  	# default reboot path (usually fast-reset)
=20
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.
=20
Signed-off-by: Vaibhav Jain <redacted>
Oh good, someone else has finally picked this up and sent a kernel=20
patch, I did the skiboot half and then neglected to make it useful (I=20
sent an RFC at https://patchwork.ozlabs.org/patch/697604/ but never=20
followed up on it... this approach seems more usable, I think).

When you say "the reboot command" - is this behaviour of passing the=20
argument common to all the important init systems/reboot utils?  What's=20
the correct systemd way to do it?
  	while (rc =3D=3D OPAL_BUSY || rc =3D=3D OPAL_BUSY_EVENT) {
-		rc =3D opal_cec_reboot();
+
+		/* See if we need to do a full IPL reboot */
+		if (cmd && strcmp(cmd, "full") =3D=3D 0)
+			rc =3D opal_cec_reboot2(OPAL_REBOOT_FULL_IPL, NULL);
You might want to check for OPAL_UNSUPPORTED here just in case we're=20
running on ancient firmware.
+		else
+			rc =3D opal_cec_reboot();
+
  		if (rc =3D=3D OPAL_BUSY_EVENT)
  			opal_poll_events(NULL);
  		else
=20
--=20
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help