[PATCH 3/3] CPU hotplug, arch/sparc: Fix CPU hotplug callback registration

From: Srivatsa S. Bhat
Date: Thu Mar 01 2012 - 03:18:55 EST



Restructure CPU hotplug setup and callback registration in topology_init
so as to be race-free.

---

arch/sparc/kernel/sysfs.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
index 654e8aa..22cb881 100644
--- a/arch/sparc/kernel/sysfs.c
+++ b/arch/sparc/kernel/sysfs.c
@@ -300,16 +300,14 @@ static int __init topology_init(void)

check_mmu_stats();

- register_cpu_notifier(&sysfs_cpu_nb);
-
for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);

register_cpu(c, cpu);
- if (cpu_online(cpu))
- register_cpu_online(cpu);
}

+ register_allcpu_notifier(&sysfs_cpu_nb, true, NULL);
+
return 0;
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/