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: Vaibhav Jain <hidden>
Date: 2018-09-03 06:00:59

Thanks for looking into this Andrew,

Andrew Donnellan [off-list ref] writes:
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).
Thanks for pointing that out. I wasnt aware of this patch.

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?
Mostly Yes,

On systemd the reboot command is just a symlink to systemctl binary that
checks argv[0] and maintains the a backward compatible behaviour. The
more systemd specific command 'systemctl reboot full' will also do the
same thing. So this patch should work on systemd.

Looking at 'upstart' I see support for adding an arg to the reboot
command since revision
https://bazaar.launchpad.net/~upstart-devel/upstart/trunk/revision/1432.3.1
. So upstart should also be supported.

I dont see support for sending an arg in 'SysVinit' halt command
yet. However this patch wont break the halt command. Just that SysVinit
systems will continue to use fast-reboot like today. Though
theorectially with this patch a SysVinit user can write a tool to issue
reboot syscall with cmd == LINUX_REBOOT_CMD_RESTART2 and arg == "full".
quoted
  	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.
Good idea, will fix this in v2.

-- 
Vaibhav Jain [off-list ref]
Linux Technology Center, IBM India Pvt. Ltd.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help