* [PATCH 0/2] prepare to treat system reset handler as NMI
@ 2017-03-20 6:31 Nicholas Piggin
2017-03-20 6:31 ` [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset Nicholas Piggin
2017-03-20 6:31 ` [PATCH 2/2] powerpc/cbe: do not process external or decremeter " Nicholas Piggin
0 siblings, 2 replies; 4+ messages in thread
From: Nicholas Piggin @ 2017-03-20 6:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Michael Ellerman
This change was discussed and tested last week. This just
splits them up and adds a changelog and SOB tags for merge.
Thanks,
Nick
Nicholas Piggin (2):
powerpc/pasemi: do not process external or decrementer interrupts from
sreset
powerpc/cbe: do not process external or decremeter interrupts from
sreset
arch/powerpc/platforms/cell/pervasive.c | 11 +++++++----
arch/powerpc/platforms/pasemi/idle.c | 11 +++++++----
2 files changed, 14 insertions(+), 8 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset
2017-03-20 6:31 [PATCH 0/2] prepare to treat system reset handler as NMI Nicholas Piggin
@ 2017-03-20 6:31 ` Nicholas Piggin
2017-05-01 2:58 ` [1/2] " Michael Ellerman
2017-03-20 6:31 ` [PATCH 2/2] powerpc/cbe: do not process external or decremeter " Nicholas Piggin
1 sibling, 1 reply; 4+ messages in thread
From: Nicholas Piggin @ 2017-03-20 6:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Michael Ellerman
PA Semi will wake from low power state at the system reset interrupt,
with the event encoded in SRR1, rather than waking at the interrupt
vector that corresponds to that event.
The system reset handler for this platform decodes SRR1 event reason
and calls the interrupt handler to process it directly from the system
reset handlre.
A subsequent change will treat the system reset interrupt as a Linux NMI
with its own per-CPU stack, and this will no longer work. Remove the
external and decrementer handlers from the system reset handler.
- The external exception remains raised and will fire again at the
EE interrupt vector when system reset returns.
- The decrementer is set to 1 so it will be raised again and fire when
the system reset returns.
It is possible to branch to an idle handler from the system reset
interrupt (like POWER does), then restore a normal stack and restore
this optimisation. But simplicity wins for now.
Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/platforms/pasemi/idle.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/pasemi/idle.c b/arch/powerpc/platforms/pasemi/idle.c
index 75b296bc51af..44e0d9226f0a 100644
--- a/arch/powerpc/platforms/pasemi/idle.c
+++ b/arch/powerpc/platforms/pasemi/idle.c
@@ -53,11 +53,14 @@ static int pasemi_system_reset_exception(struct pt_regs *regs)
regs->nip = regs->link;
switch (regs->msr & SRR1_WAKEMASK) {
- case SRR1_WAKEEE:
- do_IRQ(regs);
- break;
case SRR1_WAKEDEC:
- timer_interrupt(regs);
+ set_dec(1);
+ case SRR1_WAKEEE:
+ /*
+ * Handle these when interrupts get re-enabled and we take
+ * them as regular exceptions. We are in an NMI context
+ * and can't handle these here.
+ */
break;
default:
/* do system reset */
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset
2017-03-20 6:31 ` [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset Nicholas Piggin
@ 2017-05-01 2:58 ` Michael Ellerman
0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2017-05-01 2:58 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
On Mon, 2017-03-20 at 06:31:48 UTC, Nicholas Piggin wrote:
> PA Semi will wake from low power state at the system reset interrupt,
> with the event encoded in SRR1, rather than waking at the interrupt
> vector that corresponds to that event.
>
> The system reset handler for this platform decodes SRR1 event reason
> and calls the interrupt handler to process it directly from the system
> reset handlre.
>
> A subsequent change will treat the system reset interrupt as a Linux NMI
> with its own per-CPU stack, and this will no longer work. Remove the
> external and decrementer handlers from the system reset handler.
>
> - The external exception remains raised and will fire again at the
> EE interrupt vector when system reset returns.
>
> - The decrementer is set to 1 so it will be raised again and fire when
> the system reset returns.
>
> It is possible to branch to an idle handler from the system reset
> interrupt (like POWER does), then restore a normal stack and restore
> this optimisation. But simplicity wins for now.
>
> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/461e96a3374892d551fe270a975f33
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] powerpc/cbe: do not process external or decremeter interrupts from sreset
2017-03-20 6:31 [PATCH 0/2] prepare to treat system reset handler as NMI Nicholas Piggin
2017-03-20 6:31 ` [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset Nicholas Piggin
@ 2017-03-20 6:31 ` Nicholas Piggin
1 sibling, 0 replies; 4+ messages in thread
From: Nicholas Piggin @ 2017-03-20 6:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Nicholas Piggin, Michael Ellerman
Cell will wake from low power state at the system reset interrupt,
with the event encoded in SRR1, rather than waking at the interrupt
vector that corresponds to that event.
The system reset handler for this platform decodes SRR1 event reason
and calls the interrupt handler to process it directly from the system
reset handlre.
A subsequent change will treat the system reset interrupt as a Linux NMI
with its own per-CPU stack, and this will no longer work. Remove the
external and decrementer handlers from the system reset handler.
- The external exception remains raised and will fire again at the
EE interrupt vector when system reset returns.
- The decrementer is set to 1 so it will be raised again and fire when
the system reset returns.
It is possible to branch to an idle handler from the system reset
interrupt (like POWER does), then restore a normal stack and restore
this optimisation. But simplicity wins for now.
Tested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
arch/powerpc/platforms/cell/pervasive.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/cell/pervasive.c b/arch/powerpc/platforms/cell/pervasive.c
index e7d075077cb0..a88944db9fc3 100644
--- a/arch/powerpc/platforms/cell/pervasive.c
+++ b/arch/powerpc/platforms/cell/pervasive.c
@@ -88,11 +88,14 @@ static void cbe_power_save(void)
static int cbe_system_reset_exception(struct pt_regs *regs)
{
switch (regs->msr & SRR1_WAKEMASK) {
- case SRR1_WAKEEE:
- do_IRQ(regs);
- break;
case SRR1_WAKEDEC:
- timer_interrupt(regs);
+ set_dec(1);
+ case SRR1_WAKEEE:
+ /*
+ * Handle these when interrupts get re-enabled and we take
+ * them as regular exceptions. We are in an NMI context
+ * and can't handle these here.
+ */
break;
case SRR1_WAKEMT:
return cbe_sysreset_hack();
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-01 2:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-20 6:31 [PATCH 0/2] prepare to treat system reset handler as NMI Nicholas Piggin
2017-03-20 6:31 ` [PATCH 1/2] powerpc/pasemi: do not process external or decrementer interrupts from sreset Nicholas Piggin
2017-05-01 2:58 ` [1/2] " Michael Ellerman
2017-03-20 6:31 ` [PATCH 2/2] powerpc/cbe: do not process external or decremeter " Nicholas Piggin
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).