aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm
diff options
context:
space:
mode:
authorJesse Larrew <jlarrew@linux.vnet.ibm.com>2010-12-17 17:07:47 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-01-11 00:06:16 -0500
commit39bf990ead35c7263652ca5dd8262b2b2cd147ac (patch)
tree2aac1543090234a97d4b67f1871bbfcd857359e2 /arch/powerpc/mm
parenteed0ba0b4ab2d1668588219a8efa81bf8636a12d (diff)
powerpc/pseries: Fix VPHN build errors on non-SMP systems
The header asm/hvcall.h was previously included indirectly via smp.h. On non-SMP systems, however, these declarations are excluded and the build breaks. This is easily fixed by including asm/hvcall.h directly. The VPHN feature is only meaningful on NUMA systems that implement the SPLPAR option, so exclude the VPHN code on systems without SPLPAR enabled. Also, expose unmap_cpu_from_node() on systems with SPLPAR enabled, even if CONFIG_HOTPLUG_CPU is disabled. Lastly, map_cpu_to_node() is now needed by VPHN to manipulate the node masks after boot time, so remove the __cpuinit annotation to fix a section mismatch. Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
Diffstat (limited to 'arch/powerpc/mm')
-rw-r--r--arch/powerpc/mm/numa.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d644ba7e8aba..3c0d20c9161a 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -28,6 +28,7 @@
28#include <asm/smp.h> 28#include <asm/smp.h>
29#include <asm/firmware.h> 29#include <asm/firmware.h>
30#include <asm/paca.h> 30#include <asm/paca.h>
31#include <asm/hvcall.h>
31 32
32static int numa_enabled = 1; 33static int numa_enabled = 1;
33 34
@@ -167,7 +168,7 @@ static void __init get_node_active_region(unsigned long start_pfn,
167 work_with_active_regions(nid, get_active_region_work_fn, node_ar); 168 work_with_active_regions(nid, get_active_region_work_fn, node_ar);
168} 169}
169 170
170static void __cpuinit map_cpu_to_node(int cpu, int node) 171static void map_cpu_to_node(int cpu, int node)
171{ 172{
172 numa_cpu_lookup_table[cpu] = node; 173 numa_cpu_lookup_table[cpu] = node;
173 174
@@ -177,7 +178,7 @@ static void __cpuinit map_cpu_to_node(int cpu, int node)
177 cpumask_set_cpu(cpu, node_to_cpumask_map[node]); 178 cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
178} 179}
179 180
180#ifdef CONFIG_HOTPLUG_CPU 181#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
181static void unmap_cpu_from_node(unsigned long cpu) 182static void unmap_cpu_from_node(unsigned long cpu)
182{ 183{
183 int node = numa_cpu_lookup_table[cpu]; 184 int node = numa_cpu_lookup_table[cpu];
@@ -191,7 +192,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
191 cpu, node); 192 cpu, node);
192 } 193 }
193} 194}
194#endif /* CONFIG_HOTPLUG_CPU */ 195#endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
195 196
196/* must hold reference to node during call */ 197/* must hold reference to node during call */
197static const int *of_get_associativity(struct device_node *dev) 198static const int *of_get_associativity(struct device_node *dev)
@@ -1289,6 +1290,7 @@ u64 memory_hotplug_max(void)
1289#endif /* CONFIG_MEMORY_HOTPLUG */ 1290#endif /* CONFIG_MEMORY_HOTPLUG */
1290 1291
1291/* Vrtual Processor Home Node (VPHN) support */ 1292/* Vrtual Processor Home Node (VPHN) support */
1293#ifdef CONFIG_PPC_SPLPAR
1292#define VPHN_NR_CHANGE_CTRS (8) 1294#define VPHN_NR_CHANGE_CTRS (8)
1293static u8 vphn_cpu_change_counts[NR_CPUS][VPHN_NR_CHANGE_CTRS]; 1295static u8 vphn_cpu_change_counts[NR_CPUS][VPHN_NR_CHANGE_CTRS];
1294static cpumask_t cpu_associativity_changes_mask; 1296static cpumask_t cpu_associativity_changes_mask;
@@ -1531,3 +1533,4 @@ int stop_topology_update(void)
1531 vphn_enabled = 0; 1533 vphn_enabled = 0;
1532 return del_timer_sync(&topology_timer); 1534 return del_timer_sync(&topology_timer);
1533} 1535}
1536#endif /* CONFIG_PPC_SPLPAR */