[PATCH 07/14] [POWERPC] Populate cpu_enabled_map

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alex Chiang
Date: Monday, July 14, 2008 - 7:34 pm

Populate the cpu_enabled_map correctly.

Note that this patch does not actually make any decisions based
on the contents of the map.

However, as the map is presented via sysfs in:

	/sys/devices/system/cpu/

It should be populated correctly.

Signed-off-by: Alex Chiang <achiang@hp.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

 arch/powerpc/kernel/setup-common.c           |    1 +
 arch/powerpc/platforms/powermac/smp.c        |    1 +
 arch/powerpc/platforms/pseries/hotplug-cpu.c |    2 ++
 3 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index db540ea..a4c894a 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -413,6 +413,7 @@ void __init smp_setup_cpu_maps(void)
 			DBG("    thread %d -> cpu %d (hard id %d)\n",
 			    j, cpu, intserv[j]);
 			cpu_set(cpu, cpu_present_map);
+			cpu_set(cpu, cpu_enabled_map);
 			set_hard_smp_processor_id(cpu, intserv[j]);
 			cpu_set(cpu, cpu_possible_map);
 			cpu++;
diff --git a/arch/powerpc/platforms/powermac/smp.c b/arch/powerpc/platforms/powermac/smp.c
index cb2d894..a74dada 100644
--- a/arch/powerpc/platforms/powermac/smp.c
+++ b/arch/powerpc/platforms/powermac/smp.c
@@ -317,6 +317,7 @@ static int __init smp_psurge_probe(void)
 		ncpus = NR_CPUS;
 	for (i = 1; i < ncpus ; ++i) {
 		cpu_set(i, cpu_present_map);
+		cpu_set(i, cpu_enabled_map);
 		set_hard_smp_processor_id(i, i);
 	}
 
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 1f03248..e738b07 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -186,6 +186,7 @@ static int pseries_add_processor(struct device_node *np)
 	for_each_cpu_mask(cpu, tmp) {
 		BUG_ON(cpu_isset(cpu, cpu_present_map));
 		cpu_set(cpu, cpu_present_map);
+		cpu_set(cpu, cpu_enabled_map);
 		set_hard_smp_processor_id(cpu, *intserv++);
 	}
 	err = 0;
@@ -218,6 +219,7 @@ static void pseries_remove_processor(struct device_node *np)
 				continue;
 			BUG_ON(cpu_online(cpu));
 			cpu_clear(cpu, cpu_present_map);
+			cpu_clear(cpu, cpu_enabled_map);
 			set_hard_smp_processor_id(cpu, -1);
 			break;
 		}

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/14] Introduce cpu_enabled_map and friends, Alex Chiang, (Mon Jul 14, 7:33 pm)
[PATCH 01/14] Introduce cpu_enabled_map and friends, Alex Chiang, (Mon Jul 14, 7:33 pm)
[PATCH 02/14] [M32R] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:33 pm)
[PATCH 03/14] [ALPHA] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:33 pm)
[PATCH 04/14] [ARM] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 05/14] [MIPS] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 06/14] [PARISC] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 07/14] [POWERPC] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 08/14] [S390] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 09/14] [SH] Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 12/14] [IA64] Populate and use cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:34 pm)
[PATCH 11/14] x86: Populate cpu_enabled_map, Alex Chiang, (Mon Jul 14, 7:56 pm)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Matthew Wilcox, (Mon Jul 14, 8:15 pm)
Re: [PATCH 07/14] [POWERPC] Populate cpu_enabled_map, Benjamin Herrenschmidt, (Mon Jul 14, 10:51 pm)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Russell King, (Tue Jul 15, 3:21 am)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Alex Chiang, (Tue Jul 15, 10:57 am)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Matthew Wilcox, (Tue Jul 15, 11:16 am)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Russell King, (Tue Jul 15, 11:48 am)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Alex Chiang, (Tue Jul 15, 12:15 pm)
Re: [PATCH 07/14] [POWERPC] Populate cpu_enabled_map, Alex Chiang, (Tue Jul 15, 6:04 pm)
Re: [PATCH 11/14] x86: Populate cpu_enabled_map, H. Peter Anvin, (Fri Jul 18, 1:00 pm)
Re: [PATCH 01/14] Introduce cpu_enabled_map and friends, Russell King, (Fri Jul 18, 2:44 pm)
Re: [PATCH 11/14] x86: Populate cpu_enabled_map, Alex Chiang, (Fri Jul 18, 4:06 pm)