From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEBDCC4CEC9 for ; Sat, 14 Sep 2019 14:37:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAFB920854 for ; Sat, 14 Sep 2019 14:37:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389481AbfINOhB (ORCPT ); Sat, 14 Sep 2019 10:37:01 -0400 Received: from baldur.buserror.net ([165.227.176.147]:58980 "EHLO baldur.buserror.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388491AbfINOhB (ORCPT ); Sat, 14 Sep 2019 10:37:01 -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 1i998P-0001sT-6n; Sat, 14 Sep 2019 09:34:45 -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: Sat, 14 Sep 2019 09:34:44 -0500 In-Reply-To: <331759c1bcba5797d30f8eace74afb16ac5f3c36.1566564560.git.christophe.leroy@c-s.fr> 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: 7bit 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 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 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... -Scott