Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3224580ybe; Sun, 15 Sep 2019 10:15:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqy3AMRxxuf/iQkUSo8nCgHsx8T/QxBkKr144+eICB2wWW3/KFxcKfcrO/K4nmVBbmNiEssl X-Received: by 2002:a17:906:f205:: with SMTP id gt5mr43734765ejb.279.1568567724684; Sun, 15 Sep 2019 10:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568567724; cv=none; d=google.com; s=arc-20160816; b=Bd9Vllb8eh0yZh+NdAqYXcjwgHr5j1OjbISMXgCqakmHrSSCOItWjn3Rm874VB4e2w vH75CBfyI3DhF47M7BW7k9dmqCO8+qZHACiBObmH8dExlg0PJWt3becfNB+2mHauFAxS 8XAyUvZT2Ia+NebREucJhpAccG/DzkSzQxL8A00uKLjhWocDo8xxS4wKKEqFGoAntsUY Blj+sr1W+2djJOr31vVKWEWPLSXYGMxGaXy6Pc1Sk9DCfpu0MKbY66OgNhcrNMkMnBW5 lT9dFbIMageUxOn6lXbz+abwW9MqTchwKkC0Vg6RYWyI3PdKcpuJTS1DEF/0ZOiKvNXg xAeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :mime-version:organization:references:in-reply-to:date:cc:to:from :message-id; bh=lHPAqQFrOx2DCPojPjy9REpL9QtMQzyeMrwgBzFKFI0=; b=ivDn2wA7jELcoVG4HlR49HjCqceQG9AjrnKvlIpUDhmd4TVJl+TJpND7SdW05C9/6u Ar0+Yre7f18GLt88txxHJBf5SY4YzxhNS5fpqQkmBoOG8RbTTEMQD0YHeVjgvbG1rdl7 eUr1rvowmnNmPniEPClqXd/RaukmSqHn1ShDHdiE1aJ3Ih8pZja3kmDUgJqmfhP7NbLw 4dRmZOpm8N3s2tcgcXsNcA4I1qJ88dmdofFeAdasO05TD0QZyuy7DnQhNj5XNYq55KOw KP3ZN3bEAaHhJFTFFtki4LpvRt+SpLAsjczTfVEguaeoznHL8IewMlhINgp9IdYw6hXu qp3w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c4si19230370edv.49.2019.09.15.10.15.01; Sun, 15 Sep 2019 10:15:24 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726421AbfIORMF (ORCPT + 99 others); Sun, 15 Sep 2019 13:12:05 -0400 Received: from baldur.buserror.net ([165.227.176.147]:32810 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725270AbfIORMF (ORCPT ); Sun, 15 Sep 2019 13:12:05 -0400 Received: from [2601:449:8480:af0:12bf:48ff:fe84:c9a0] by baldur.buserror.net with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1i9Y1u-00037s-1D; Sun, 15 Sep 2019 12:09:42 -0500 Message-ID: From: Scott Wood To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , galak@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Sun, 15 Sep 2019 12:09:40 -0500 In-Reply-To: References: <331759c1bcba5797d30f8eace74afb16ac5f3c36.1566564560.git.christophe.leroy@c-s.fr> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2601:449:8480:af0:12bf:48ff:fe84:c9a0 X-SA-Exim-Rcpt-To: christophe.leroy@c-s.fr, benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au, galak@kernel.crashing.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org X-SA-Exim-Mail-From: oss@buserror.net X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on baldur.localdomain X-Spam-Level: X-Spam-Status: No, score=-17.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -15 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -1.5 GREYLIST_ISWHITE The incoming server has been whitelisted for * this recipient and sender Subject: Re: [PATCH 2/2] powerpc/83xx: map IMMR with a BAT. X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on baldur.buserror.net) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2019-09-14 at 18:51 +0200, Christophe Leroy wrote: > > Le 14/09/2019 à 16:34, Scott Wood a écrit : > > On Fri, 2019-08-23 at 12:50 +0000, Christophe Leroy wrote: > > > On mpc83xx with a QE, IMMR is 2Mbytes. > > > On mpc83xx without a QE, IMMR is 1Mbytes. > > > Each driver will map a part of it to access the registers it needs. > > > Some driver will map the same part of IMMR as other drivers. > > > > > > In order to reduce TLB misses, map the full IMMR with a BAT. > > > > > > Signed-off-by: Christophe Leroy > > > --- > > > arch/powerpc/platforms/83xx/misc.c | 10 ++++++++++ > > > 1 file changed, 10 insertions(+) > > > > > > diff --git a/arch/powerpc/platforms/83xx/misc.c > > > b/arch/powerpc/platforms/83xx/misc.c > > > index f46d7bf3b140..1e395b01c535 100644 > > > --- a/arch/powerpc/platforms/83xx/misc.c > > > +++ b/arch/powerpc/platforms/83xx/misc.c > > > @@ -18,6 +18,8 @@ > > > #include > > > #include > > > > > > +#include > > > + > > > #include "mpc83xx.h" > > > > > > static __be32 __iomem *restart_reg_base; > > > @@ -145,6 +147,14 @@ void __init mpc83xx_setup_arch(void) > > > if (ppc_md.progress) > > > ppc_md.progress("mpc83xx_setup_arch()", 0); > > > > > > + if (!__map_without_bats) { > > > + int immrsize = IS_ENABLED(CONFIG_QUICC_ENGINE) ? SZ_2M : > > > SZ_1M; > > > > Any reason not to unconditionally make it 2M? After all, the kernel being > > built with CONFIG_QUICC_ENGINE doesn't mean that the hardware you're > > running > > on has it... > > > > Euh .. ok. I didn't see it that way, but you are right. > > Do you think it is not a problem to map 2M even when the quicc engine is > not there ? Or should it check device tree instead ? It should be OK, since it's a guarded mapping. Unless the IMMR base is not 2M aligned... -Scott