Skip to contentSkip to conversation

MIPS:CMP Fix physical core number calculation logic

PATCH Applied jerin jacob 2 participants 2 messages Oct 11, 2012 – Oct 18, 2012 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 MIPS:CMP Fix physical core number calculation logic

CPUNum Field in EBase register is 10bit wide, so after 1 bit right shift, mask value should be 0x1ff

---
 arch/mips/kernel/smp-cmp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/mips/kernel/smp-cmp.c +1 -1
index afc379c..06cd0c6 100644
@@ -97,7 +97,7 @@ static void cmp_init_secondary(void)
 
 	/* Enable per-cpu interrupts: platform specific */
 
-	c->core = (read_c0_ebase() >> 1) & 0xff;
+	c->core = (read_c0_ebase() >> 1) & 0x1ff;
 #if defined(CONFIG_MIPS_MT_SMP) || defined(CONFIG_MIPS_MT_SMTC)
 	c->vpe_id = (read_c0_tcbind() >> TCBIND_CURVPE_SHIFT) & TCBIND_CURVPE;
 #endif
Signature · 1 line
1.7.6.5
Applied
#1 lore raw
Quoted 2 lines · jerin jacob

CPUNum Field in EBase register is 10bit wide, so after 1 bit right shift, mask value should be 0x1ff

Fortunately nobody has a CMP with more than 256 cores yet :-)

Applied. Thanks,

Ralf