Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753118AbdHDRAd (ORCPT ); Fri, 4 Aug 2017 13:00:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43244 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753010AbdHDRAb (ORCPT ); Fri, 4 Aug 2017 13:00:31 -0400 Date: Fri, 4 Aug 2017 22:30:19 +0530 From: Gautham R Shenoy To: "Gautham R. Shenoy" Cc: Michael Ellerman , Michael Neuling , Nicholas Piggin , Vaidyanathan Srinivasan , Shilpasri G Bhat , "Rafael J. Wysocki" , Akshay Adiga , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH] powernv:idle: Disable LOSE_FULL_CONTEXT states when stop-api fails. Reply-To: ego@linux.vnet.ibm.com References: <1501830262-32399-1-git-send-email-ego@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1501830262-32399-1-git-send-email-ego@linux.vnet.ibm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-GCONF: 00 x-cbid: 17080417-0016-0000-0000-0000074B8D9C X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007484; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000217; SDB=6.00897523; UDB=6.00449095; IPR=6.00677707; BA=6.00005509; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016535; XFM=3.00000015; UTC=2017-08-04 17:00:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17080417-0017-0000-0000-00003AE53FE3 Message-Id: <20170804170019.GA17813@in.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-04_08:,, 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-1706020000 definitions=main-1708040261 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1248 Lines: 33 On Fri, Aug 04, 2017 at 12:34:22PM +0530, Gautham R. Shenoy wrote: > From: "Gautham R. Shenoy" > > Currently, we use the opal call opal_slw_set_reg() to inform the > Sleep-Winkle Engine (SLW) to restore the contents of some of the > Hypervisor state on wakeup from deep idle states that lose full > hypervisor context (characterized by the flag > OPAL_PM_LOSE_FULL_CONTEXT). > > However, the current code has a bug in that if opal_slw_set_reg() > fails, we don't disable the use of these deep states (winkle on > POWER8, stop4 onwards on POWER9). > > This patch fixes this bug by ensuring that if programing the > sleep-winkle engine to restore the hypervisor states in > pnv_save_sprs_for_deep_states() fails, then we exclude such states by > excluding their flags supported_cpuidle_states. Further, we ensure in > the initialization of the cpuidle-powernv driver to only include those > states whose flags are present in supported_cpuidle_states. > > Fixes: 1e1601b38e6 ("powerpc/powernv/idle: Restore SPRs for deep idle > states via stop API.") > Forgot to add Reported-by: Akshay Adiga > Signed-off-by: Gautham R. Shenoy -- Thanks and Regards gautham.