From: Hanjun Guo hanjun.guo@linaro.org
arch_fix_phys_package_id() will use the slot number provided by ACPI, then we can get the right value in the "physical id" field of /proc/cpuinfo.
Signed-off-by: Hanjun Guo hanjun.guo@linaro.org --- arch/arm/include/asm/topology.h | 1 + arch/arm/kernel/topology.c | 11 +++++++++++ 2 files changed, 12 insertions(+)
diff --git a/arch/arm/include/asm/topology.h b/arch/arm/include/asm/topology.h index 58b8b84..a7809fc 100644 --- a/arch/arm/include/asm/topology.h +++ b/arch/arm/include/asm/topology.h @@ -26,6 +26,7 @@ extern struct cputopo_arm cpu_topology[NR_CPUS]; void init_cpu_topology(void); void store_cpu_topology(unsigned int cpuid); const struct cpumask *cpu_coregroup_mask(int cpu); +void arch_fix_phys_package_id(int num, u32 slot);
#else
diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c index c5a5954..1cb4350 100644 --- a/arch/arm/kernel/topology.c +++ b/arch/arm/kernel/topology.c @@ -289,6 +289,17 @@ void store_cpu_topology(unsigned int cpuid) cpu_topology[cpuid].socket_id, mpidr); }
+void arch_fix_phys_package_id(int num, u32 slot) +{ +#ifdef CONFIG_SMP + struct cputopo_arm *cpuid_topo = &cpu_topology[num]; + + if (cpuid_topo->socket_id == -1) + cpuid_topo->socket_id = slot; +#endif +} +EXPORT_SYMBOL_GPL(arch_fix_phys_package_id); + /* * init_cpu_topology is called at boot when only one cpu is running * which prevent simultaneous write access to cpu_topology array