public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] powerpc: Fixes to allow pseries to build for HOTPLUG_CPU=n
@ 2010-02-28  7:29 Paul E. McKenney
  0 siblings, 0 replies; only message in thread
From: Paul E. McKenney @ 2010-02-28  7:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: benh, anton, paulus, akpm

Building for a pseries machine with HOTPLUG_CPU=n on 2.6.33 gives the
following build errors:

arch/powerpc/platforms/built-in.o: In function `.smp_xics_setup_cpu':
smp.c:(.devinit.text+0x8c): undefined reference to `.set_cpu_current_state'
smp.c:(.devinit.text+0x98): undefined reference to `.set_default_offline_state'
arch/powerpc/platforms/built-in.o: In function `.smp_pSeries_kick_cpu':
smp.c:(.devinit.text+0x13c): undefined reference to `.get_cpu_current_state'
smp.c:(.devinit.text+0x1c4): undefined reference to `.set_preferred_offline_state'
smp.c:(.devinit.text+0x1d0): undefined reference to `.get_cpu_current_state'

This patch fixes this by providing empty (or nearly empty) functions for
the HOTPLUG_CPU=n case.  Passes moderate rcutorture testing.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---

 offline_states.h |   30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/arch/powerpc/platforms/pseries/offline_states.h b/arch/powerpc/platforms/pseries/offline_states.h
index 22574e0..195f9c7 100644
--- a/arch/powerpc/platforms/pseries/offline_states.h
+++ b/arch/powerpc/platforms/pseries/offline_states.h
@@ -9,10 +9,40 @@ enum cpu_state_vals {
 	CPU_MAX_OFFLINE_STATES
 };
 
+#ifdef CONFIG_HOTPLUG_CPU
+
 extern enum cpu_state_vals get_cpu_current_state(int cpu);
 extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
 extern enum cpu_state_vals get_preferred_offline_state(int cpu);
 extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
 extern void set_default_offline_state(int cpu);
+
+#else /* #ifdef CONFIG_HOTPLUG_CPU */
+
+static inline enum cpu_state_vals get_cpu_current_state(int cpu)
+{
+	return cpu_online(cpu) ? CPU_STATE_ONLINE : CPU_STATE_OFFLINE;
+}
+
+static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state)
+{
+}
+
+static inline enum cpu_state_vals get_preferred_offline_state(int cpu)
+{
+	return CPU_STATE_OFFLINE;
+}
+
+static inline void set_preferred_offline_state(int cpu,
+					       enum cpu_state_vals state)
+{
+}
+
+static inline void set_default_offline_state(int cpu)
+{
+}
+
+#endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
+
 extern int start_secondary(void);
 #endif

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-02-28  7:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-28  7:29 [PATCH RFC] powerpc: Fixes to allow pseries to build for HOTPLUG_CPU=n Paul E. McKenney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox