Skip to content

Commit 30ee615

Browse files
paulburtonralfbaechle
authored andcommitted
MIPS: Fix core number detection for MT cores
In cores which implement the MT ASE, the CPUNum in the EBase register is a concatenation of the core number & the VPE ID within that core. In order to retrieve the correct core number CPUNum must be shifted appropriately to remove the VPE ID bits. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6666/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent 968a073 commit 30ee615

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎arch/mips/kernel/cpu-probe.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <asm/cpu-type.h>
2424
#include <asm/fpu.h>
2525
#include <asm/mipsregs.h>
26+
#include <asm/mipsmtregs.h>
2627
#include <asm/msa.h>
2728
#include <asm/watch.h>
2829
#include <asm/elf.h>
@@ -421,8 +422,11 @@ static void decode_configs(struct cpuinfo_mips *c)
421422
mips_probe_watch_registers(c);
422423

423424
#ifndef CONFIG_MIPS_CPS
424-
if (cpu_has_mips_r2)
425+
if (cpu_has_mips_r2) {
425426
c->core = read_c0_ebase() & 0x3ff;
427+
if (cpu_has_mipsmt)
428+
c->core >>= fls(core_nvpes()) - 1;
429+
}
426430
#endif
427431
}
428432

0 commit comments

Comments
 (0)