Skip to content

Commit

Permalink
MIPS: Fix early CM probing
Browse files Browse the repository at this point in the history
Commit c014d16 ("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 <paul.burton@imgtec.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Peter Hurley <peter@hurleysoftware.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Jaedon Shin <jaedon.shin@gmail.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Jonas Gorski <jogo@openwrt.org>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/12475/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  • Loading branch information
Paul Burton authored and Ralf Baechle committed Feb 9, 2016
1 parent e6c058f commit 3af5a67
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 1 addition & 0 deletions arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 0 additions & 10 deletions arch/mips/mm/sc-mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = &current_cpu_data;
Expand All @@ -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();

Expand Down
8 changes: 0 additions & 8 deletions arch/mips/mti-malta/malta-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ void __init prom_init(void)
console_config();
#endif
/* Early detection of CMP support */
mips_cm_probe();
mips_cpc_probe();

if (!register_cps_smp_ops())
Expand All @@ -304,10 +303,3 @@ void __init prom_init(void)
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();
}

0 comments on commit 3af5a67

Please sign in to comment.