Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp270585ybt; Thu, 9 Jul 2020 22:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTkaL8Au3T3OeVymDMIyuEEU8jnz0xoWPhoCtcxI/kXrG8nxEHz0rLjqo6xnzyo+H9bavy X-Received: by 2002:a50:f08c:: with SMTP id v12mr74257281edl.119.1594358978446; Thu, 09 Jul 2020 22:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594358978; cv=none; d=google.com; s=arc-20160816; b=gEt+VovZrAwYlLo+15R6TO/9JAf2zvlmzbGsphyWgbHWtdp8t0CAxviwmO7IDs8oSG c+PypqiUUuj5v2+QByi5P6Ga2j62lSFJwI/3dM7OG4DkQFDHlXymh1IHFjpnR3LyurCL 02lJ2L8iPZkqagIpJegXSNqWZb6OZp90Tk4tcbOLjg7ilTT+I3ke2rJtbas2OAi8YSEZ os6kJOLeL891f0eZFSqCC8IAk9YDJxGjIg+46mnR7ZqjS9Alf58ozPRKmg23BtG4Kf0Y e4zTk/Dseh7j+h+YkMOkhKjHeIj7qIVGfqhnuCLu+XNG/Btt7SzJ/+b4Fkh2Nk9/OALv P74Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from; bh=qnZziLIDDBBX9xGqYioBWrbib7A6ukg99Zr7cQZfZR0=; b=gHWv5JTA1oAAGUMA21nvDngx73miNmF23JsRBCtKixPPbSs8JQRgP74Q8o1s9Cy8Tk MXGwbC0LHe1fBcdOyyjn1jW7ZxY5QyZhb2WH+nCJv+zd72OuBA5WaWr4LUK6XmR8GZm+ jd1Y8gxTm0ZQlmGlmRsV225FTtWbmXoDlE7hk5fuvLmBeB8NDID4X1N768yDcgzucHFK 5m10Bi9jR4ofw3vwcYXJmBr7SkNZuQ6kDCtHkI4eDh08M92NHXtV57ylonstuCnb8iCj oumy/lHVvRjQl1b8ZHFTLw8j+UecxspdHtmyK/5ofRgwliB8qJQHFuGJTQCYQZmxtiNl efaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id gs7si3323502ejb.262.2020.07.09.22.29.16; Thu, 09 Jul 2020 22:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727068AbgGJF2u (ORCPT + 99 others); Fri, 10 Jul 2020 01:28:50 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50814 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbgGJFWr (ORCPT ); Fri, 10 Jul 2020 01:22:47 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 06A5233a065689; Fri, 10 Jul 2020 01:22:20 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 326bpk836s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jul 2020 01:22:19 -0400 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 06A54svC071807; Fri, 10 Jul 2020 01:22:19 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 326bpk8365-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jul 2020 01:22:19 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 06A5GaN0032336; Fri, 10 Jul 2020 05:22:17 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 326bc309me-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Jul 2020 05:22:17 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 06A5MErN8651142 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 10 Jul 2020 05:22:14 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 692F4A4054; Fri, 10 Jul 2020 05:22:14 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 85164A405B; Fri, 10 Jul 2020 05:22:12 +0000 (GMT) Received: from pratiks-thinkpad.ibmuc.com (unknown [9.85.105.207]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 10 Jul 2020 05:22:12 +0000 (GMT) From: Pratik Rajesh Sampat To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, mikey@neuling.org, ravi.bangoria@linux.ibm.com, ego@linux.vnet.ibm.com, svaidy@linux.ibm.com, psampat@linux.ibm.com, pratik.r.sampat@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0,DAWRX0 for P10 Date: Fri, 10 Jul 2020 10:52:06 +0530 Message-Id: <20200710052207.12003-3-psampat@linux.ibm.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200710052207.12003-1-psampat@linux.ibm.com> References: <20200710052207.12003-1-psampat@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-10_01:2020-07-09,2020-07-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 lowpriorityscore=0 clxscore=1015 priorityscore=1501 bulkscore=0 impostorscore=0 mlxscore=0 mlxlogscore=840 spamscore=0 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007100029 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Additional registers DAWR0, DAWRX0 may be lost on Power 10 for stop levels < 4. Therefore save the values of these SPRs before entering a "stop" state and restore their values on wakeup. Signed-off-by: Pratik Rajesh Sampat --- arch/powerpc/platforms/powernv/idle.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/platforms/powernv/idle.c b/arch/powerpc/platforms/powernv/idle.c index 19d94d021357..f2e2a6a4c274 100644 --- a/arch/powerpc/platforms/powernv/idle.c +++ b/arch/powerpc/platforms/powernv/idle.c @@ -600,6 +600,8 @@ struct p9_sprs { u64 iamr; u64 amor; u64 uamor; + u64 dawr0; + u64 dawrx0; }; static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on) @@ -687,6 +689,10 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on) sprs.iamr = mfspr(SPRN_IAMR); sprs.amor = mfspr(SPRN_AMOR); sprs.uamor = mfspr(SPRN_UAMOR); + if (cpu_has_feature(CPU_FTR_ARCH_31)) { + sprs.dawr0 = mfspr(SPRN_DAWR0); + sprs.dawrx0 = mfspr(SPRN_DAWRX0); + } srr1 = isa300_idle_stop_mayloss(psscr); /* go idle */ @@ -710,6 +716,10 @@ static unsigned long power9_idle_stop(unsigned long psscr, bool mmu_on) mtspr(SPRN_IAMR, sprs.iamr); mtspr(SPRN_AMOR, sprs.amor); mtspr(SPRN_UAMOR, sprs.uamor); + if (cpu_has_feature(CPU_FTR_ARCH_31)) { + mtspr(SPRN_DAWR0, sprs.dawr0); + mtspr(SPRN_DAWRX0, sprs.dawrx0); + } /* * Workaround for POWER9 DD2.0, if we lost resources, the ERAT -- 2.25.4