Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752335AbcLEJX4 (ORCPT ); Mon, 5 Dec 2016 04:23:56 -0500 Received: from 001b2d01.pphosted.com ([148.163.156.1]:51035 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751634AbcLEJXS (ORCPT ); Mon, 5 Dec 2016 04:23:18 -0500 Date: Mon, 5 Dec 2016 14:52:11 +0530 From: Gautham R Shenoy To: Balbir Singh Cc: "Gautham R. Shenoy" , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , "Rafael J. Wysocki" , Daniel Lezcano , Michael Neuling , Vaidyanathan Srinivasan , "Shreyas B. Prabhu" , Shilpasri G Bhat , Stewart Smith , "Oliver O'Halloran" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v3 1/3] powernv:idle: Add IDLE_STATE_ENTER_SEQ_NORET macro Reply-To: ego@linux.vnet.ibm.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16120509-8235-0000-0000-000009C07BB8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00006192; HX=3.00000240; KW=3.00000007; PH=3.00000004; SC=3.00000194; SDB=6.00789495; UDB=6.00382226; IPR=6.00567235; BA=6.00004938; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00013539; XFM=3.00000011; UTC=2016-12-05 09:22:19 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16120509-8236-0000-0000-000036FF0B5D Message-Id: <20161205092211.GA24305@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-05_06:,, 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-1612050169 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1593 Lines: 51 Hi Balbir, On Tue, Nov 29, 2016 at 09:42:20PM +1100, Balbir Singh wrote: > > > On 10/11/16 18:54, Gautham R. Shenoy wrote: > > From: "Gautham R. Shenoy" > > > > Currently all the low-power idle states are expected to wake up > > at reset vector 0x100. Which is why the macro IDLE_STATE_ENTER_SEQ > > that puts the CPU to an idle state and never returns. > > > > On ISA_300, when the ESL and EC bits in the PSSCR are zero, the > > CPU is expected to wake up at the next instruction of the idle > > instruction. > > > > This patch adds a new macro named IDLE_STATE_ENTER_SEQ_NORET for the > > I think something like IDLE_STATE_ENTER_SEQ_LOSE_CTX would be better? As you pointed out below, the macro encapsulates the magic sequence that needs to be executed to go to a particular idle-state. The behaviour changes based on ESL=EC=1 (or nap,fastsleep,winkle on POWER8) in which case wake up is at 0x100. When ESL=EC=0, the wakeup happens at the subsequent instruction. So, more than whether the context is lost or not, the intent is to indicate whether the wakeup happens at the next instruction or at 0x100. > > > no-return variant and reuses the name IDLE_STATE_ENTER_SEQ > > for a variant that allows resuming operation at the instruction next > > to the idle-instruction. > > > > > + > > +#define IDLE_STATE_ENTER_SEQ_NORET(IDLE_INST) \ > > + IDLE_STATE_ENTER_SEQ(IDLE_INST) \ > > So we start off with both as the same? > > > b . > > #endif /* CONFIG_PPC_P7_NAP */ > > Balbir > -- Thanks and Regards gautham.