From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758908AbcIPJsS (ORCPT ); Fri, 16 Sep 2016 05:48:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50330 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758067AbcIPJsC (ORCPT ); Fri, 16 Sep 2016 05:48:02 -0400 From: "Gautham R. Shenoy" To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Vaidyanathan Srinivasan , Michael Ellerman , "Shreyas B. Prabhu" , Michael Neuling , Shilpasri G Bhat , "Gautham R. Shenoy" Subject: [PATCH 0/2] powernv: Implement lite variant of stop with ESL=EC=0 Date: Fri, 16 Sep 2016 15:17:40 +0530 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16091609-0056-0000-0000-00000161A288 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00005770; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000185; SDB=6.00758265; UDB=6.00359864; IPR=6.00531943; BA=6.00004731; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00012691; XFM=3.00000011; UTC=2016-09-16 09:47:59 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16091609-0057-0000-0000-00000594A307 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-09-16_05:,, 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-1609020000 definitions=main-1609160121 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Gautham R. Shenoy" Hi, The Power ISA v3.0 allows us to execute the "stop" instruction with ESL and EC of the PSSCR set to 0. This will ensure no loss of state, and the wakeup from the stop will happen at an instruction following the executed stop instruction. This patchset adds support to run stop with ESL=EC=0 based on a flag set for the corresponding stop state in the device tree. The first patch renames the IDLE_STATE_ENTER_SEQ macro to IDLE_STATE_ENTER_SEQ_NORET since the current users of this macro expect the wakeup from stop to happen at the System Reset vector. It reuses the name IDLE_STATE_ENTER_SEQ to a variant where the wakeup from stop happens at the next instruction. The second patch creates adds a new function (i.e, a lite variant) that will execute a stop instruction with ESL=EC=0 and handle wakeup at the subsequent instruction. A particular stop state is wired to this new function if the device tree entry for that stop state has OPAL_PM_WAKEUP_AT_NEXT_INST [1] flag set. [1] : The corresponding patch in skiboot that defines OPAL_PM_WAKEUP_AT_NEXT_INST and enables it in the device tree can be found here: https://lists.ozlabs.org/pipermail/skiboot/2016-September/004805.html Gautham R. Shenoy (2): powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro powernv:idle:Implement lite variant of power_enter_stop arch/powerpc/include/asm/cpuidle.h | 5 ++++- arch/powerpc/include/asm/opal-api.h | 1 + arch/powerpc/include/asm/processor.h | 3 ++- arch/powerpc/kernel/exceptions-64s.S | 6 +++--- arch/powerpc/kernel/idle_book3s.S | 38 +++++++++++++++++++++++++++-------- arch/powerpc/platforms/powernv/idle.c | 17 +++++++++++++--- arch/powerpc/platforms/powernv/smp.c | 2 +- drivers/cpuidle/cpuidle-powernv.c | 24 ++++++++++++++++++++-- 8 files changed, 77 insertions(+), 19 deletions(-) -- 1.9.4