Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1786119ybh; Thu, 23 Jul 2020 18:26:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVrhBeL8AYZXnDBqz9E4hxfeB51XXWcRW+B0t0/wym4pDm8px6q6vSOKDbQp6sZH0vX73w X-Received: by 2002:a17:907:11dd:: with SMTP id va29mr5510167ejb.470.1595553976975; Thu, 23 Jul 2020 18:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595553976; cv=none; d=google.com; s=arc-20160816; b=K3se6hYNmc+BMDiUinsHs54ykJXnGCivcUsArqf/W1Kg41nc4VHJA7Mx+v6xajV6Lj 7fwz3+UGn9AUICYpXJxkFoSFbgLHoZ+XyBzdm0c3/lyjRMvLvdCPL4x4PXq4wxXDA1Vd z2U/+z9Q0p63iKT+cK0xSxDxK8GY4rMnOfG7AUnDPJuEVYLgjCOblRqq/OBqnN8nHBMk NDUt/m2KpT+Ul/HsMk58qm3Qg4nmZ12/27+gpfPA3YLVEKdfaPv5Kr1XJxep7VttRByl w98ib1eH1nFvp07iS/XjiMxqVgm5IdrU7XBN5aRwOPwnsd/SW8Oj9KJezvg1a/JhjBFb whUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:to:from :subject:message-id:dkim-signature; bh=6YPPWTXuJnkVIyL5/qJe8LZGBhC2uP6aC7tvEvFCW5U=; b=R7L/4mtKSnBAsR08U/Hi2asWFcI6WjUzYtKnYu7FaE/tKmU0o+lphVfZ1VeyhPHlyF oDodK5Jz93HxTh7s1lWWwwdnREbV4E5xir3aHCa9ntQA6J0Nuo9JYxP9xQWx1fyUE2DF f7x0I+P8IaE9PCnEJ78IfpWxCH8ztRAlcj9yHQuxcjOUKkg+ONg7cM6ni0oyRfGLxBqa N2nNl+Y85k61PKBgBHIOwOJUGOBFXawPgKMQa2ft8ELP8m9A8YEoUZ/pNo/Ljtdt4hVs z0ip+Qu5R8BtMCl2/iROUZATaL0E3JRkBB7rfKH/siwMv6OcT9CViKrwSE9BWKHxRJBH eDiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@neuling.org header.s=201811 header.b=XOKW50YA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y3si680633ede.295.2020.07.23.18.25.53; Thu, 23 Jul 2020 18:26:16 -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; dkim=pass header.i=@neuling.org header.s=201811 header.b=XOKW50YA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbgGXBZ1 (ORCPT + 99 others); Thu, 23 Jul 2020 21:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgGXBZ0 (ORCPT ); Thu, 23 Jul 2020 21:25:26 -0400 Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FBEBC0619D3 for ; Thu, 23 Jul 2020 18:25:26 -0700 (PDT) Received: from neuling.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 4BCWjH2XG7z9sPB; Fri, 24 Jul 2020 11:25:23 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=neuling.org; s=201811; t=1595553924; bh=tm/GU39NPJjOhnUmHyDDcZvMhBdG0uDx7EnJQcKGEho=; h=Subject:From:To:Date:In-Reply-To:References:From; b=XOKW50YAnge0+7ZmdCpLdxd8P+Gx1IVElGxDtqg7n8o2DtROhV6Gd/km0jYnjiC5d /guTMY0h5sHwhoVmVXsZFdgGiGM9zm11xlDj4acp0AgSgtthMRCkNppZKXVVdG4iMg JERKTsxs0ZF3wBBn9wjRNUEyGlmhJhF0hZCj6qrOhp1HbGf0lwrJ5PKG9bEDe0sM53 J8o/9EnQDDNAxlM/rMc/M5KUEUi26pwhuMQgxnB2wu4egOTE0sBUQ9/Ml1Zt01Ve3w pUVyVFS4/UiiX4lK6r5AKsCnqErfhyLdIIW+MCNbRLYdgaQO1KyqcYNBh6aAUWkz1f 3o3gS8l4YgcjA== Received: by neuling.org (Postfix, from userid 1000) id 3D9482C0404; Fri, 24 Jul 2020 11:25:23 +1000 (AEST) Message-ID: Subject: Re: [PATCH v2 2/3] powerpc/powernv/idle: save-restore DAWR0,DAWRX0 for P10 From: Michael Neuling To: Pratik Rajesh Sampat , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, ravi.bangoria@linux.ibm.com, ego@linux.vnet.ibm.com, svaidy@linux.ibm.com, pratik.r.sampat@gmail.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Date: Fri, 24 Jul 2020 11:25:23 +1000 In-Reply-To: <20200710052207.12003-3-psampat@linux.ibm.com> References: <20200710052207.12003-1-psampat@linux.ibm.com> <20200710052207.12003-3-psampat@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.4 (3.36.4-1.fc32) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-07-10 at 10:52 +0530, Pratik Rajesh Sampat wrote: > 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. >=20 > Signed-off-by: Pratik Rajesh Sampat > --- > arch/powerpc/platforms/powernv/idle.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) >=20 > 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; > }; > =20 > 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 =3D mfspr(SPRN_IAMR); > sprs.amor =3D mfspr(SPRN_AMOR); > sprs.uamor =3D mfspr(SPRN_UAMOR); > + if (cpu_has_feature(CPU_FTR_ARCH_31)) { Can you add a comment here saying even though DAWR0 is ARCH_30, it's only required to be saved on 31. Otherwise this looks pretty odd. > + sprs.dawr0 =3D mfspr(SPRN_DAWR0); > + sprs.dawrx0 =3D mfspr(SPRN_DAWRX0); > + } > =20 > srr1 =3D isa300_idle_stop_mayloss(psscr); /* go idle */ > =20 > @@ -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); > + } > =20 > /* > * Workaround for POWER9 DD2.0, if we lost resources, the ERAT