From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757450AbcBIPrG (ORCPT ); Tue, 9 Feb 2016 10:47:06 -0500 Received: from demumfd001.nsn-inter.net ([93.183.12.32]:54663 "EHLO demumfd001.nsn-inter.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107AbcBIPrD (ORCPT ); Tue, 9 Feb 2016 10:47:03 -0500 Subject: Re: [PATCH] MIPS: Fix early CM probing To: EXT Paul Burton , linux-mips@linux-mips.org References: <1454953591-19491-1-git-send-email-paul.burton@imgtec.com> Cc: Andrzej Hajda , Aaro Koskinen , Masahiro Yamada , Rob Herring , Alexander Sverdlin , Peter Hurley , linux-kernel@vger.kernel.org, Leonid Yegoshin , Jaedon Shin , James Hogan , Jonas Gorski , Markos Chandras , Ralf Baechle From: Alexander Sverdlin Message-ID: <56BA09D6.1080002@nokia.com> Date: Tue, 9 Feb 2016 16:46:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1454953591-19491-1-git-send-email-paul.burton@imgtec.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-purgate-type: clean X-purgate-Ad: Categorized by eleven eXpurgate (R) http://www.eleven.de X-purgate: clean X-purgate: This mail is considered clean (visit http://www.eleven.de for further information) X-purgate-size: 3155 X-purgate-ID: 151667::1455032792-000006B0-EEF31170/0/0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On 08.02.2016 18:46, EXT Paul Burton wrote: > Commit c014d164f21d ("MIPS: Add platform callback before initializing > the L2 cache") added a platform_early_l2_init function in order to allow > platforms to probe for the CM before L2 initialisation is performed, so > that CM GCRs are available to mips_sc_probe. > > That commit actually fails to do anything useful, since it checks > mips_cm_revision to determine whether it should call mips_cm_probe but > the result of mips_cm_revision will always be 0 until mips_cm_probe has > been called. Thus the "early" mips_cm_probe call never occurs. > > Fix this & drop the useless weak platform_early_l2_init function by > simply calling mips_cm_probe from setup_arch. For platforms that don't > select CONFIG_MIPS_CM this will be a no-op, and for those that do it > removes the requirement for them to call mips_cm_probe manually > (although doing so isn't harmful for now). > > Signed-off-by: Paul Burton Reviewed-by: Alexander Sverdlin > --- > > arch/mips/kernel/setup.c | 1 + > arch/mips/mm/sc-mips.c | 10 ---------- > arch/mips/mti-malta/malta-init.c | 8 -------- > 3 files changed, 1 insertion(+), 18 deletions(-) > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index 569a7d5..5fdaf8b 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -782,6 +782,7 @@ static inline void prefill_possible_map(void) {} > void __init setup_arch(char **cmdline_p) > { > cpu_probe(); > + mips_cm_probe(); > prom_init(); > > setup_early_fdc_console(); > diff --git a/arch/mips/mm/sc-mips.c b/arch/mips/mm/sc-mips.c > index 3bd0597..2496475 100644 > --- a/arch/mips/mm/sc-mips.c > +++ b/arch/mips/mm/sc-mips.c > @@ -181,10 +181,6 @@ static int __init mips_sc_probe_cm3(void) > return 1; > } > > -void __weak platform_early_l2_init(void) > -{ > -} > - > static inline int __init mips_sc_probe(void) > { > struct cpuinfo_mips *c = ¤t_cpu_data; > @@ -194,12 +190,6 @@ static inline int __init mips_sc_probe(void) > /* Mark as not present until probe completed */ > c->scache.flags |= MIPS_CACHE_NOT_PRESENT; > > - /* > - * Do we need some platform specific probing before > - * we configure L2? > - */ > - platform_early_l2_init(); > - > if (mips_cm_revision() >= CM_REV_CM3) > return mips_sc_probe_cm3(); > > diff --git a/arch/mips/mti-malta/malta-init.c b/arch/mips/mti-malta/malta-init.c > index 571148c..dc2c521 100644 > --- a/arch/mips/mti-malta/malta-init.c > +++ b/arch/mips/mti-malta/malta-init.c > @@ -293,7 +293,6 @@ mips_pci_controller: > console_config(); > #endif > /* Early detection of CMP support */ > - mips_cm_probe(); > mips_cpc_probe(); > > if (!register_cps_smp_ops()) > @@ -304,10 +303,3 @@ mips_pci_controller: > return; > register_up_smp_ops(); > } > - > -void platform_early_l2_init(void) > -{ > - /* L2 configuration lives in the CM3 */ > - if (mips_cm_revision() >= CM_REV_CM3) > - mips_cm_probe(); > -} >