linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/pasemi, cbe: Do not process decremeter or external wakeup from powersave
@ 2017-03-15 15:43 Nicholas Piggin
  2017-03-16 10:31 ` Michael Ellerman
  0 siblings, 1 reply; 7+ messages in thread
From: Nicholas Piggin @ 2017-03-15 15:43 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Nicholas Piggin, Michael Ellerman, Arnd Bergmann

Hi,

I would like to start using a dedicated stack for system reset interrupt
and treat it as a Linux nmi, which makes it tricky to call complex
interrupt handlers directly from the system reset trap handler.

So I would like to remove the decrementer and external handler calls from
Cell and Pasemi platforms' system reset handler. I think we can just
remove them if they can be handled when they re-fire as normal interrupts?
At the moment I don't have environments set up to test if this works.

This will make the powersave wakeup a bit slower. We could add alternate
code to IDLETEST here to branch out to powersave wakeup handler like
powernv does. I haven't got a patch for that yet but I could help write
one if it is important and it can be tested.

Thanks,
Nick
---
 arch/powerpc/platforms/cell/pervasive.c | 11 +++++++----
 arch/powerpc/platforms/pasemi/idle.c    | 11 +++++++----
 2 files changed, 14 insertions(+), 8 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();
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] 7+ messages in thread
* [PATCH] powerpc/pasemi, cbe: Do not process decremeter or external wakeup from powersave
@ 2017-03-17 14:43 Christian Zigotzky
  2017-03-18 12:46 ` Nicholas Piggin
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Zigotzky @ 2017-03-17 14:43 UTC (permalink / raw)
  To: linuxppc-dev

Nicholas Piggin <npiggin at gmail.com> writes:

 > Hi,
 >
 > I would like to start using a dedicated stack for system reset interrupt
 > and treat it as a Linux nmi, which makes it tricky to call complex
 > interrupt handlers directly from the system reset trap handler.
 >
 > So I would like to remove the decrementer and external handler calls from
 > Cell and Pasemi platforms' system reset handler. I think we can just
 > remove them if they can be handled when they re-fire as normal 
interrupts?
 > At the moment I don't have environments set up to test if this works.


It works fine with my AmigaOne X1000. (Nemo board with a P.A. Semi  
PA6T-1682M CPU)

-- Christian

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-18 12:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-15 15:43 [PATCH] powerpc/pasemi, cbe: Do not process decremeter or external wakeup from powersave Nicholas Piggin
2017-03-16 10:31 ` Michael Ellerman
2017-03-17  6:12   ` Michael Ellerman
2017-03-17  7:48     ` [PATCH] powerpc/pasemi,cbe: " Nicholas Piggin
2017-03-17 10:17       ` [PATCH] powerpc/pasemi, cbe: " Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2017-03-17 14:43 Christian Zigotzky
2017-03-18 12:46 ` 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).