From: Paul Burton Date: Thu, 27 Mar 2014 10:57:30 +0000 (+0000) Subject: MIPS: Fix core number detection for MT cores X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30ee615bb86ba640c9ec7f85fb95c1b0e31c41be;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6666/ Signed-off-by: Ralf Baechle --- diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index bd712c91f48b..6e8fb85ce7c3 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -421,8 +422,11 @@ static void decode_configs(struct cpuinfo_mips *c) mips_probe_watch_registers(c); #ifndef CONFIG_MIPS_CPS - if (cpu_has_mips_r2) + if (cpu_has_mips_r2) { c->core = read_c0_ebase() & 0x3ff; + if (cpu_has_mipsmt) + c->core >>= fls(core_nvpes()) - 1; + } #endif }