@@ -34,10 +34,7 @@ static inline bool is_smp(void)
*/
static inline unsigned int smp_cpuid_part(int cpu)
{
- struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpu);
-
- return is_smp() ? cpu_info->cpuid & ARM_CPU_PART_MASK :
- read_cpuid_part();
+ return per_cpu(cpu_data, cpu).cpuid;
}
/* all SMP configurations have the extended CPUID registers */
@@ -724,6 +724,9 @@ static void __init setup_processor(void)
cacheid_init();
cpu_init();
+
+ /* Always setup the boot CPU ID in the per-cpu data */
+ per_cpu(cpu_data, smp_processor_id()).cpuid = read_cpuid_id();
}
void __init dump_machine_table(void)
@@ -1217,7 +1220,7 @@ static int c_show(struct seq_file *m, void *v)
* "processor". Give glibc what it expects.
*/
seq_printf(m, "processor\t: %d\n", i);
- cpuid = is_smp() ? per_cpu(cpu_data, i).cpuid : read_cpuid_id();
+ cpuid = per_cpu(cpu_data, i).cpuid;
seq_printf(m, "model name\t: %s rev %d (%s)\n",
cpu_name, cpuid & 15, elf_platform);
Always store the CPU ID into the percpu data so that it is available early on. This allows us to eliminate various is_smp() tests that select between reading the hardware CPU ID directly and reading from the percpu data. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> --- arch/arm/include/asm/smp_plat.h | 5 +---- arch/arm/kernel/setup.c | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-)