sparc64: Defer cpu_data() setup until end of per-cpu data initialization.
authorDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2009 05:37:25 +0000 (22:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Jun 2009 11:56:22 +0000 (04:56 -0700)
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/kernel/ds.c
arch/sparc/kernel/mdesc.c
arch/sparc/kernel/prom_64.c
arch/sparc/kernel/smp_64.c
arch/sparc/mm/init_64.c

index 51b05c49887714dcf31a7f0c1c2fa1a70f6dd7f7..4a700f4b79cebf068cba0c82ea22dcf6602ba74b 100644 (file)
@@ -544,6 +544,7 @@ static int __cpuinit dr_cpu_configure(struct ds_info *dp,
                             resp_len, ncpus, mask,
                             DR_CPU_STAT_CONFIGURED);
 
+       mdesc_populate_present_mask(mask);
        mdesc_fill_in_cpu_data(mask);
 
        for_each_cpu_mask(cpu, *mask) {
index 6d2015e0e5744d78ee01f0927be0d260da63e784..938da19dc06527d755d7ce0a9cc8171b39f654c7 100644 (file)
@@ -861,7 +861,6 @@ void __cpuinit mdesc_fill_in_cpu_data(cpumask_t *mask)
 {
        struct mdesc_handle *hp;
 
-       mdesc_populate_present_mask(mask);
        mdesc_iterate_over_cpus(fill_in_one_cpu, NULL, mask);
 
 #ifdef CONFIG_SMP
index 4d92f488fae1773a00517ad32d33745413eda86b..fb06ac2bd38ffbb198080dc9006775fdab0b55f1 100644 (file)
@@ -535,7 +535,6 @@ void __init of_fill_in_cpu_data(void)
        if (tlb_type == hypervisor)
                return;
 
-       of_populate_present_mask();
        of_iterate_over_cpus(fill_in_one_cpu, 0);
 
        smp_fill_in_sib_core_maps();
index b20f253857b7ba0e9ee0ffda9fe158dbe31b7952..045fbb554a9c4461471de961207bbf53fd5038a7 100644 (file)
@@ -1399,4 +1399,8 @@ void __init real_setup_per_cpu_areas(void)
 
        /* Setup %g5 for the boot cpu.  */
        __local_per_cpu_offset = __per_cpu_offset(smp_processor_id());
+
+       of_fill_in_cpu_data();
+       if (tlb_type == hypervisor)
+               mdesc_fill_in_cpu_data(CPU_MASK_ALL_PTR);
 }
index 87fea94e5125c93b138eabcd61039d7111a7c808..785f0a24fcbf37d4bc2a83551479d7a397fcb1aa 100644 (file)
@@ -1799,20 +1799,16 @@ void __init paging_init(void)
        if (tlb_type == hypervisor)
                sun4v_ktsb_register();
 
-       /* We must setup the per-cpu areas before we pull in the
-        * PROM and the MDESC.  The code there fills in cpu and
-        * other information into per-cpu data structures.
-        */
-       real_setup_per_cpu_areas();
-
        prom_build_devicetree();
-       of_fill_in_cpu_data();
+       of_populate_present_mask();
 
        if (tlb_type == hypervisor) {
                sun4v_mdesc_init();
-               mdesc_fill_in_cpu_data(CPU_MASK_ALL_PTR);
+               mdesc_populate_present_mask(CPU_MASK_ALL_PTR);
        }
 
+       real_setup_per_cpu_areas();
+
        /* Once the OF device tree and MDESC have been setup, we know
         * the list of possible cpus.  Therefore we can allocate the
         * IRQ stacks.