Skip to content

Commit 39bf990

Browse files
Jesse Larrewozbenh
authored andcommitted
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>
1 parent eed0ba0 commit 39bf990

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

arch/powerpc/include/asm/topology.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,20 @@ extern void __init dump_numa_cpu_topology(void);
9393
extern int sysfs_add_device_to_node(struct sys_device *dev, int nid);
9494
extern void sysfs_remove_device_from_node(struct sys_device *dev, int nid);
9595

96+
#ifdef CONFIG_PPC_SPLPAR
9697
extern int start_topology_update(void);
9798
extern int stop_topology_update(void);
9899
#else
100+
static inline int start_topology_update(void)
101+
{
102+
return 0;
103+
}
104+
static inline int stop_topology_update(void)
105+
{
106+
return 0;
107+
}
108+
#endif /* CONFIG_PPC_SPLPAR */
109+
#else
99110

100111
static inline void dump_numa_cpu_topology(void) {}
101112

@@ -108,15 +119,6 @@ static inline void sysfs_remove_device_from_node(struct sys_device *dev,
108119
int nid)
109120
{
110121
}
111-
112-
static inline int start_topology_update(void)
113-
{
114-
return 0;
115-
}
116-
static inline int stop_topology_update(void)
117-
{
118-
return 0;
119-
}
120122
#endif /* CONFIG_NUMA */
121123

122124
#include <asm-generic/topology.h>

arch/powerpc/mm/numa.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <asm/smp.h>
2929
#include <asm/firmware.h>
3030
#include <asm/paca.h>
31+
#include <asm/hvcall.h>
3132

3233
static int numa_enabled = 1;
3334

@@ -167,7 +168,7 @@ static void __init get_node_active_region(unsigned long start_pfn,
167168
work_with_active_regions(nid, get_active_region_work_fn, node_ar);
168169
}
169170

170-
static void __cpuinit map_cpu_to_node(int cpu, int node)
171+
static void map_cpu_to_node(int cpu, int node)
171172
{
172173
numa_cpu_lookup_table[cpu] = node;
173174

@@ -177,7 +178,7 @@ static void __cpuinit map_cpu_to_node(int cpu, int node)
177178
cpumask_set_cpu(cpu, node_to_cpumask_map[node]);
178179
}
179180

180-
#ifdef CONFIG_HOTPLUG_CPU
181+
#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_PPC_SPLPAR)
181182
static void unmap_cpu_from_node(unsigned long cpu)
182183
{
183184
int node = numa_cpu_lookup_table[cpu];
@@ -191,7 +192,7 @@ static void unmap_cpu_from_node(unsigned long cpu)
191192
cpu, node);
192193
}
193194
}
194-
#endif /* CONFIG_HOTPLUG_CPU */
195+
#endif /* CONFIG_HOTPLUG_CPU || CONFIG_PPC_SPLPAR */
195196

196197
/* must hold reference to node during call */
197198
static const int *of_get_associativity(struct device_node *dev)
@@ -1289,6 +1290,7 @@ u64 memory_hotplug_max(void)
12891290
#endif /* CONFIG_MEMORY_HOTPLUG */
12901291

12911292
/* Vrtual Processor Home Node (VPHN) support */
1293+
#ifdef CONFIG_PPC_SPLPAR
12921294
#define VPHN_NR_CHANGE_CTRS (8)
12931295
static u8 vphn_cpu_change_counts[NR_CPUS][VPHN_NR_CHANGE_CTRS];
12941296
static cpumask_t cpu_associativity_changes_mask;
@@ -1531,3 +1533,4 @@ int stop_topology_update(void)
15311533
vphn_enabled = 0;
15321534
return del_timer_sync(&topology_timer);
15331535
}
1536+
#endif /* CONFIG_PPC_SPLPAR */

0 commit comments

Comments
 (0)