Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4649798ybf; Wed, 4 Mar 2020 08:02:43 -0800 (PST) X-Google-Smtp-Source: ADFU+vsHsSho6Z4AncRjCrlQOfSvsOzOmJnb/ihEOKWOVQDJwzExjMopidN3fxymjyg9yV+aLu16 X-Received: by 2002:a05:6830:1e58:: with SMTP id e24mr2969254otj.267.1583337763545; Wed, 04 Mar 2020 08:02:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583337763; cv=none; d=google.com; s=arc-20160816; b=K7JlPzIb5eKqsKUXKpGgFSRJuTDOWQoadZvOcDkxwEWhdMtF1GDtoO8GJnzwnSjUwq H25FACNaUujmWS7p2eF/bAfRNyGrFWuv4V1EPVFMRmfIr7jrq0T/k9wYG0tOCdXbLCb3 6VGNUWj36L+/CfMOQeyDrCRYccl0qbxOITpTslCm4yLQnzKEb4JwUgsZ0Yv59ETXE0kA 6FK/LZxon14tGoKs9Ekg6cyDCPlr7kzrSSDhbieERSCpuJejkJ969tYI+C050CcnRD2c xyQNe2boqP52kYv5j3SSmp+ct3ErJIzt71l3YZdgB1wDarpkxUUWX7GhSAUElq46MAbM zFsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:references:in-reply-to:date:subject:to:from; bh=vwAilMDNRM58gHrdFa4oC1ctLomvVwrJTTzY8hx8mhk=; b=u396IynbkAHtlMBHb0pGUUN0WPf0FnMEyC3Ct+iBKIXC0S+L4OwxFSftFdBN5JM9dl H95i3zWVwMbhSWNiKybrBuvUF5WSJxMU4gmPCdPZoICmoexq9ffCXXU/c9VRQ6HUwTsK Kk9ndaQSbU/sze6VPfBHwj3lOya8CabiVREhG5GbbZScVNpu6whIes7FjSddm/lUdlAr 1RLa9tUERSi9CV5jFoFaLOGnLVTqG2WEIdKvL9HER/VZ0S0L2l6ljFFibiyTViV2mBlK RaCIPDACHNB7+LpI68onjcihoJBa9yg92F2yetulthV9t3ga9AjiopNz0NLLptY079Nm qLTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a25si1320607oid.67.2020.03.04.08.02.29; Wed, 04 Mar 2020 08:02:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388184AbgCDQBo (ORCPT + 99 others); Wed, 4 Mar 2020 11:01:44 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53026 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbgCDQBn (ORCPT ); Wed, 4 Mar 2020 11:01:43 -0500 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 024Fxxq5101630 for ; Wed, 4 Mar 2020 11:01:43 -0500 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 2yhrydsjw6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 04 Mar 2020 11:01:40 -0500 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 4 Mar 2020 16:01:38 -0000 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 4 Mar 2020 16:01:36 -0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 024G1YjR55050250 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 4 Mar 2020 16:01:34 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EF773AE055; Wed, 4 Mar 2020 16:01:33 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B2F71AE045; Wed, 4 Mar 2020 16:01:31 +0000 (GMT) Received: from pratiks-thinkpad.ibmuc.com (unknown [9.85.81.47]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 4 Mar 2020 16:01:31 +0000 (GMT) From: Pratik Rajesh Sampat To: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, mikey@neuling.org, npiggin@gmail.com, vaidy@linux.ibm.com, ego@linux.vnet.ibm.com, skiboot@lists.ozlabs.org, oohall@gmail.com, psampat@linux.ibm.com, pratik.r.sampat@gmail.com Subject: [RFC 3/3] Introduce capability for firmware-enabled-stop Date: Wed, 4 Mar 2020 21:31:23 +0530 X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 20030416-0008-0000-0000-000003595304 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 20030416-0009-0000-0000-00004A7A873F Message-Id: <55fa5021e4de901f05ded8b669777711bf2a9724.1583332695.git.psampat@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-03-04_05:2020-03-04,2020-03-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 spamscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2003040118 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Design patch that introduces the capability for firmware to handle the stop states instead. A bit is set based on the discovery of the feature and correspondingly also the responsibility to handle the stop states. The commit does not contain calling into the firmware to utilize firmware enabled stop. Signed-off-by: Pratik Rajesh Sampat --- arch/powerpc/include/asm/processor.h | 1 + arch/powerpc/kernel/dt_cpu_ftrs.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/arch/powerpc/include/asm/processor.h b/arch/powerpc/include/asm/processor.h index 277dbabafd02..978fab35d133 100644 --- a/arch/powerpc/include/asm/processor.h +++ b/arch/powerpc/include/asm/processor.h @@ -430,6 +430,7 @@ extern unsigned long cpuidle_disable; enum idle_boot_override {IDLE_NO_OVERRIDE = 0, IDLE_POWERSAVE_OFF}; #define STOP_ENABLE 0x00000001 +#define FIRMWARE_STOP_ENABLE 0x00000010 #define STOP_VERSION_P9 0x1 #define STOP_VERSION_P9_V1 0x2 diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c index 63e30aa49356..e00f8afabc46 100644 --- a/arch/powerpc/kernel/dt_cpu_ftrs.c +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c @@ -313,6 +313,14 @@ static int __init feat_enable_idle_stop_quirk(struct dt_cpu_feature *f) return 1; } + +static int __init feat_enable_firmware_stop(struct dt_cpu_feature *f) +{ + stop_dep.cpuidle_prop |= FIRMWARE_STOP_ENABLE; + + return 1; +} + static int __init feat_enable_mmu_hash(struct dt_cpu_feature *f) { u64 lpcr; @@ -608,6 +616,7 @@ static struct dt_cpu_feature_match __initdata {"alignment-interrupt-dsisr", feat_enable_align_dsisr, 0}, {"idle-stop", feat_enable_idle_stop, 0}, {"idle-stop-v1", feat_enable_idle_stop_quirk, 0}, + {"firmware-stop-supported", feat_enable_firmware_stop, 0}, {"machine-check-power8", feat_enable_mce_power8, 0}, {"performance-monitor-power8", feat_enable_pmu_power8, 0}, {"data-stream-control-register", feat_enable_dscr, CPU_FTR_DSCR}, -- 2.24.1