From patchwork Fri Feb 24 06:34:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaidyanathan Srinivasan X-Patchwork-Id: 731937 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vV1dr74jBz9s0Z for ; Fri, 24 Feb 2017 17:38:40 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vV1dr6JM6zDqL9 for ; Fri, 24 Feb 2017 17:38:40 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vV1Z64k13zDqJM for ; Fri, 24 Feb 2017 17:35:26 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v1O6SgES100478 for ; Fri, 24 Feb 2017 01:35:24 -0500 Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) by mx0a-001b2d01.pphosted.com with ESMTP id 28td8bwfk2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 24 Feb 2017 01:35:24 -0500 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Feb 2017 16:35:21 +1000 Received: from d23dlp03.au.ibm.com (202.81.31.214) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 24 Feb 2017 16:35:19 +1000 Received: from d23relay07.au.ibm.com (d23relay07.au.ibm.com [9.190.26.37]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 318BB3578052 for ; Fri, 24 Feb 2017 17:35:19 +1100 (EST) Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay07.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v1O6ZB8134013346 for ; Fri, 24 Feb 2017 17:35:19 +1100 Received: from d23av02.au.ibm.com (localhost [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v1O6Ykq0006457 for ; Fri, 24 Feb 2017 17:34:46 +1100 Received: from drishya.in.ibm.com ([9.85.72.242]) by d23av02.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v1O6YcGm005617; Fri, 24 Feb 2017 17:34:45 +1100 From: Vaidyanathan Srinivasan To: Michael Neuling Subject: [PATCH 1/2] powerpc/cpuhotplug: Force ESL=1 for offline cpus Date: Fri, 24 Feb 2017 12:04:15 +0530 X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170224063416.7201-1-svaidy@linux.vnet.ibm.com> References: <20170224063416.7201-1-svaidy@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 17022406-1617-0000-0000-000001AC741D X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17022406-1618-0000-0000-000047CC0B57 Message-Id: <20170224063416.7201-2-svaidy@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-02-24_04:, , 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-1612050000 definitions=main-1702240067 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Gautham R . Shenoy" , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Gautham R. Shenoy ESL=1 losses some HYP SPR context and not idea for cpuidle, however can be used for offline cpus. Signed-off-by: Vaidyanathan Srinivasan Signed-off-by: Gautham R. Shenoy --- arch/powerpc/include/asm/cpuidle.h | 15 +++++++++++++++ arch/powerpc/platforms/powernv/idle.c | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/arch/powerpc/include/asm/cpuidle.h b/arch/powerpc/include/asm/cpuidle.h index fd321eb4..31192d8 100644 --- a/arch/powerpc/include/asm/cpuidle.h +++ b/arch/powerpc/include/asm/cpuidle.h @@ -40,6 +40,21 @@ #define ERR_EC_ESL_MISMATCH -1 #define ERR_DEEP_STATE_ESL_MISMATCH -2 +/* Additional defs for debug and trace */ + +#define RL_SHIFT 0 +#define MTL_SHIFT 4 +#define TR_SHIFT 8 +#define PSLL_SHIFT 16 +#define EC_SHIFT 20 +#define ESL_SHIFT 21 +#define INIT_PSSCR(ESL, EC, PSLL, TR, MTL, RL) (((ESL) << (ESL_SHIFT)) | \ + ((EC) << (EC_SHIFT)) | \ + ((PSLL) << (PSLL_SHIFT)) | \ + ((TR) << (TR_SHIFT)) | \ + ((MTL) << (MTL_SHIFT)) | \ + ((RL) << (RL_SHIFT))) + #ifndef __ASSEMBLY__ extern u32 pnv_fastsleep_workaround_at_entry[]; extern u32 pnv_fastsleep_workaround_at_exit[]; diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c index 4ee837e..4f0663a 100644 --- a/arch/powerpc/platforms/powernv/idle.c +++ b/arch/powerpc/platforms/powernv/idle.c @@ -524,6 +524,17 @@ static int __init pnv_init_idle_states(void) pnv_alloc_idle_core_states(); + /* On POWER9 DD1, enter stop2 with ESL=EC=1 on Hotplug */ + if (cpu_has_feature(CPU_FTR_POWER9_DD1)) { + pnv_deepest_stop_psscr_val = + /* ESL, EC, PSSL, TR, MTL, RL */ + INIT_PSSCR(0x1, 0x1, 0xf, 0x3, 0x3, 0x2); + pnv_deepest_stop_psscr_mask = PSSCR_HV_DEFAULT_MASK; + pr_warn("Overriding deepest_stop_psscr to: val=0x%016llx,mask=0x%016llx\n", + pnv_deepest_stop_psscr_val, + pnv_deepest_stop_psscr_mask); + } + if (supported_cpuidle_states & OPAL_PM_NAP_ENABLED) ppc_md.power_save = power7_idle; else if (supported_cpuidle_states & OPAL_PM_STOP_INST_FAST)