* [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart()
@ 2019-11-01 8:55 Oliver O'Halloran
2019-11-01 8:55 ` [PATCH 2/2] powerpc/powernv: Allow manually invoking special reboots Oliver O'Halloran
2020-01-29 5:17 ` [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Oliver O'Halloran @ 2019-11-01 8:55 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
On PowerNV a few different kinds of reboot are supported. We'd like to be
able to exercise these from xmon so allow 'zr' to take an argument, and
pass that to the ppc_md.restart() function.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
arch/powerpc/xmon/xmon.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index d83364e..6a6f675 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -1147,16 +1147,19 @@ static int do_step(struct pt_regs *regs)
static void bootcmds(void)
{
+ char tmp[64];
int cmd;
cmd = inchar();
- if (cmd == 'r')
- ppc_md.restart(NULL);
- else if (cmd == 'h')
+ if (cmd == 'r') {
+ getstring(tmp, 64);
+ ppc_md.restart(tmp);
+ } else if (cmd == 'h') {
ppc_md.halt();
- else if (cmd == 'p')
+ } else if (cmd == 'p') {
if (pm_power_off)
pm_power_off();
+ }
}
static int cpu_cmd(void)
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] powerpc/powernv: Allow manually invoking special reboots
2019-11-01 8:55 [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Oliver O'Halloran
@ 2019-11-01 8:55 ` Oliver O'Halloran
2020-01-29 5:17 ` [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Oliver O'Halloran @ 2019-11-01 8:55 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Oliver O'Halloran
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>
---
arch/powerpc/platforms/powernv/setup.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 8349860..11fdae8 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -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;
--
2.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart()
2019-11-01 8:55 [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Oliver O'Halloran
2019-11-01 8:55 ` [PATCH 2/2] powerpc/powernv: Allow manually invoking special reboots Oliver O'Halloran
@ 2020-01-29 5:17 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2020-01-29 5:17 UTC (permalink / raw)
To: Oliver O'Halloran, linuxppc-dev; +Cc: Oliver O'Halloran
On Fri, 2019-11-01 at 08:55:21 UTC, Oliver O'Halloran wrote:
> On PowerNV a few different kinds of reboot are supported. We'd like to be
> able to exercise these from xmon so allow 'zr' to take an argument, and
> pass that to the ppc_md.restart() function.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/2d9b332d99b24f27f77e9ba38ce3c8beb11a81c0
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-01-29 5:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-01 8:55 [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Oliver O'Halloran
2019-11-01 8:55 ` [PATCH 2/2] powerpc/powernv: Allow manually invoking special reboots Oliver O'Halloran
2020-01-29 5:17 ` [PATCH 1/2] powerpc/xmon: Allow passing an argument to ppc_md.restart() Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).