]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm64: Delay cpuinfo_store_boot_cpu
authorSuzuki K. Poulose <suzuki.poulose@arm.com>
Mon, 19 Oct 2015 13:24:40 +0000 (14:24 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Wed, 21 Oct 2015 14:33:39 +0000 (15:33 +0100)
At the moment the boot CPU stores the cpuinfo long before the
PERCPU areas are initialised by the kernel. This could be problematic
as the non-boot CPU data structures might get copied with the data
from the boot CPU, giving us no chance to detect if a particular CPU
updated its cpuinfo. This patch delays the boot cpu store to
smp_prepare_boot_cpu().

Also kills the setup_processor() which no longer does meaningful
work.

Signed-off-by: Suzuki K. Poulose <suzuki.poulose@arm.com>
Tested-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/setup.c
arch/arm64/kernel/smp.c

index 4f0408e1df0d11b66bc673c23550af2905f6971d..47e00514159898ba7a7c2d273aac61a6f7dad87f 100644 (file)
@@ -286,13 +286,6 @@ void __init setup_cpu_features(void)
 #endif
 }
 
-static void __init setup_processor(void)
-{
-       pr_info("Boot CPU: AArch64 Processor [%08x]\n", read_cpuid_id());
-       sprintf(init_utsname()->machine, ELF_PLATFORM);
-       cpuinfo_store_boot_cpu();
-}
-
 static void __init setup_machine_fdt(phys_addr_t dt_phys)
 {
        void *dt_virt = fixmap_remap_fdt(dt_phys);
@@ -404,8 +397,9 @@ u64 __cpu_logical_map[NR_CPUS] = { [0 ... NR_CPUS-1] = INVALID_HWID };
 
 void __init setup_arch(char **cmdline_p)
 {
-       setup_processor();
+       pr_info("Boot CPU: AArch64 Processor [%08x]\n", read_cpuid_id());
 
+       sprintf(init_utsname()->machine, ELF_PLATFORM);
        init_mm.start_code = (unsigned long) _text;
        init_mm.end_code   = (unsigned long) _etext;
        init_mm.end_data   = (unsigned long) _edata;
index 77763d9cb510029d0b15190137031381e4894b95..d1d00499f0cfb352351e3951a9b8555f6a6fb6b0 100644 (file)
@@ -327,6 +327,7 @@ void __init smp_cpus_done(unsigned int max_cpus)
 
 void __init smp_prepare_boot_cpu(void)
 {
+       cpuinfo_store_boot_cpu();
        set_my_cpu_offset(per_cpu_offset(smp_processor_id()));
 }