Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1527762

[PATCH v2] powernv: Handle wakeup from idle due to SRESET

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.mixmin.net!news.unit0.net!news.panservice.it!bofh.it!news.nic.it!robomod
From "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH v2] powernv: Handle wakeup from idle due to SRESET
Date Tue, 22 Nov 2016 18:40:02 +0100
Message-ID <sGnd0-1Py-49@gated-at.bofh.it> (permalink)
References <sG1Fw-4P0-7@gated-at.bofh.it>
X-Mailer git-send-email 1.8.3.1
X-Tm-As-Gconf 00
X-Content-Scanned Fidelis XPS MAILER
X-Cbid 16112217-0056-0000-0000-0000020121A0
X-Ibm-Spammodules-Versions BY=3.00006124; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000189; SDB=6.00783960; UDB=6.00378654; IPR=6.00561578; BA=6.00004902; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013408; XFM=3.00000011; UTC=2016-11-22 17:36:51
X-Ibm-Av-Detection SAVI=unused REMOTE=unused XFE=unused
X-Cbparentid 16112217-0057-0000-0000-0000063423A8
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2016-11-22_10:,, signatures=0
X-Proofpoint-Spam-Details rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611220308
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 64
Organization linux.* mail to news gateway
X-Original-Cc linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>
X-Original-Date Tue, 22 Nov 2016 23:06:32 +0530
X-Original-Message-ID <1479836192-21233-1-git-send-email-ego@linux.vnet.ibm.com>
X-Original-References <1479753469-10625-1-git-send-email-ego@linux.vnet.ibm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1527762

Show key headers only | View raw


From: "Gautham R. Shenoy" <ego@linux.vnet.ibm.com>

The existing code doesn't handle the case when CPU which was in a
hardware-idle state (nap,sleep,winkle on POWER8 and various stop
states on POWER9) gets woken up due to a System Reset interrupt.

This patch checks if the CPU was woken up due to System Reset, in
which case, after restoring the required hardware state, it jumps to
the system reset handler.

Signed-off-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>
---
v1 -> v2: Set r9,r11,r12 to CR,SRR0,SRR1 values
before jumping to system_reset_common as expected by
EXCEPTION_PROLOG_COMMON

 arch/powerpc/kernel/idle_book3s.S | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/arch/powerpc/kernel/idle_book3s.S b/arch/powerpc/kernel/idle_book3s.S
index 72dac0b..06afe0e 100644
--- a/arch/powerpc/kernel/idle_book3s.S
+++ b/arch/powerpc/kernel/idle_book3s.S
@@ -353,6 +353,22 @@ ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_ARCH_207S, 66);		\
 	ld	r3,ORIG_GPR3(r1);	/* Restore original r3 */	\
 20:	nop;
 
+#define CHECK_SRESET_INTERRUPT                                          \
+BEGIN_FTR_SECTION_NESTED(67);						\
+	mfspr	r0,SPRN_SRR1;						\
+	rlwinm	r0,r0,45-31,0xf; /* Extract wake reason field (P8,9) */ \
+	cmpwi	r0,0x4;		  /* System Reset ? 	*/		\
+	bne	21f;							\
+	ld	r1,PACAR1(r13);						\
+	ld	r9,_CCR(r1);						\
+	ld	r11,_NIP(r1);						\
+	mfspr	r12, SPRN_SRR1;						\
+	b	system_reset_common ;					\
+	b	.; 		/* We shouldn't return here */		\
+FTR_SECTION_ELSE_NESTED(67);						\
+	nop		   ;						\
+ALT_FTR_SECTION_END_NESTED_IFSET(CPU_FTR_ARCH_207S, 67); \
+21:	nop;
 
 /*
  * r3 - requested stop state
@@ -644,6 +660,7 @@ _GLOBAL(pnv_wakeup_loss)
 	ld	r1,PACAR1(r13)
 BEGIN_FTR_SECTION
 	CHECK_HMI_INTERRUPT
+	CHECK_SRESET_INTERRUPT
 END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
 	REST_NVGPRS(r1)
 	REST_GPR(2, r1)
@@ -666,6 +683,7 @@ _GLOBAL(pnv_wakeup_noloss)
 	bne	pnv_wakeup_loss
 BEGIN_FTR_SECTION
 	CHECK_HMI_INTERRUPT
+	CHECK_SRESET_INTERRUPT
 END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
 	ld	r1,PACAR1(r13)
 	ld	r6,_CCR(r1)
-- 
1.8.3.1

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC/PATCH] powernv: Handle wakeup from stop due to SRESET "Gautham R. Shenoy" <ego@linux.vnet.ibm.com> - 2016-11-21 19:40 +0100
  [PATCH v2] powernv: Handle wakeup from idle due to SRESET "Gautham R. Shenoy" <ego@linux.vnet.ibm.com> - 2016-11-22 18:40 +0100
    Re: [PATCH v2] powernv: Handle wakeup from idle due to SRESET Paul Mackerras <paulus@ozlabs.org> - 2016-11-22 22:20 +0100

csiph-web