Skip to contentSkip to conversation

MIPS: BMIPS: couple of fixes

PATCH In review Florian Fainelli 2 participants 4 messages Aug 19, 2020 – Aug 21, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover MIPS: BMIPS: couple of fixes

Hi Thomas,

These two patches are fixes for the BMIPS5000/5200 CPU cores which were missing an inclusive physical cache setting from the cpuinfo structure and we would not be calling CPU specific initialization for secondarey cores on the second hardware thread.

Thanks!

Florian Fainelli (2):
MIPS: mm: BMIPS5000 has inclusive physical caches
MIPS: BMIPS: Also call bmips_cpu_setup() for secondary cores

 arch/mips/kernel/smp-bmips.c | 2 ++
 arch/mips/mm/c-r4k.c         | 4 ++++
 2 files changed, 6 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 MIPS: mm: BMIPS5000 has inclusive physical caches

When the BMIPS generic cpu-feature-overrides.h file was introduced, cpu_has_inclusive_caches/MIPS_CPU_INCLUSIVE_CACHES was not set for BMIPS5000 CPUs. Correct this when we have initialized the MIPS secondary cache successfully.

Fixes f337967d6d87 ("MIPS: BMIPS: Add cpu-feature-overrides.h")
---
 arch/mips/mm/c-r4k.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/mips/mm/c-r4k.c +4 -0
index fc5a6d25f74f..0ef717093262 100644
@@ -1712,7 +1712,11 @@ static void setup_scache(void)
 				printk("MIPS secondary cache %ldkB, %s, linesize %d bytes.\n",
 				       scache_size >> 10,
 				       way_string[c->scache.ways], c->scache.linesz);
+
+				if (current_cpu_type() == CPU_BMIPS5000)
+					c->options |= MIPS_CPU_INCLUSIVE_CACHES;
 			}
+
 #else
 			if (!(c->scache.flags & MIPS_CACHE_NOT_PRESENT))
 				panic("Dunno how to handle MIPS32 / MIPS64 second level cache");
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 MIPS: BMIPS: Also call bmips_cpu_setup() for secondary cores

In reply to Florian Fainelli

The initialization done by bmips_cpu_setup() typically affects both threads of a given core, on 7435 which supports 2 cores and 2 threads, logical CPU number 2 and 3 would not run this initialization.

Fixes 738a3f79027b ("MIPS: BMIPS: Add early CPU initialization code")
---
 arch/mips/kernel/smp-bmips.c | 2 ++
 1 file changed, 2 insertions(+)
arch/mips/kernel/smp-bmips.c +2 -0
index 2f513506a3d5..1dbfb5aadffd 100644
@@ -239,6 +239,8 @@ static int bmips_boot_secondary(int cpu, struct task_struct *idle)
  */
 static void bmips_init_secondary(void)
 {
+	bmips_cpu_setup();
+
 	switch (current_cpu_type()) {
 	case CPU_BMIPS4350:
 	case CPU_BMIPS4380:
Signature · 1 line
2.17.1
#3 lore raw
In reply to Florian Fainelli
Quoted 9 lines · Florian Fainelli

Hi Thomas,

These two patches are fixes for the BMIPS5000/5200 CPU cores which were missing an inclusive physical cache setting from the cpuinfo structure and we would not be calling CPU specific initialization for secondarey cores on the second hardware thread.

Thanks!

Quoted 7 lines

Florian Fainelli (2):
MIPS: mm: BMIPS5000 has inclusive physical caches
MIPS: BMIPS: Also call bmips_cpu_setup() for secondary cores

 arch/mips/kernel/smp-bmips.c | 2 ++
 arch/mips/mm/c-r4k.c         | 4 ++++
 2 files changed, 6 insertions(+)

series applied to mips-fixes.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]