diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2011-04-24 11:04:31 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-05-18 23:09:21 -0400 |
commit | 35d215fbe4f4d3569f2adabd8d53510a26ecb9c5 (patch) | |
tree | 26c809153cd5ae3f0a2133af66424c1723ba40ed /arch/powerpc | |
parent | 69e3cea8d5fd52677f2b6219542d0f8b53fe4c80 (diff) |
powerpc/kexec: Fix build failure on 32-bit SMP
Commit b987812b3fcaf70fdf0037589e5d2f5f2453e6ce left
crash_kexec_wait_realmode() undefined for UP.
Commit 7c7a81b53e581d727d069cc45df5510516faac31 defined it for UP but
left it undefined for 32-bit SMP.
Seems like people are getting confused by nested #ifdef's, so move the
definitions of crash_kexec_wait_realmode() after the #ifdef CONFIG_SMP
section.
Compile-tested with 32-bit UP, 32-bit SMP and 64-bit SMP configurations.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/kernel/crash.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index 5b5e1f002a8e..5eb0ee37f6cd 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
@@ -162,34 +162,6 @@ static void crash_kexec_prepare_cpus(int cpu) | |||
162 | /* Leave the IPI callback set */ | 162 | /* Leave the IPI callback set */ |
163 | } | 163 | } |
164 | 164 | ||
165 | /* wait for all the CPUs to hit real mode but timeout if they don't come in */ | ||
166 | #ifdef CONFIG_PPC_STD_MMU_64 | ||
167 | static void crash_kexec_wait_realmode(int cpu) | ||
168 | { | ||
169 | unsigned int msecs; | ||
170 | int i; | ||
171 | |||
172 | msecs = 10000; | ||
173 | for (i=0; i < NR_CPUS && msecs > 0; i++) { | ||
174 | if (i == cpu) | ||
175 | continue; | ||
176 | |||
177 | while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) { | ||
178 | barrier(); | ||
179 | if (!cpu_possible(i)) { | ||
180 | break; | ||
181 | } | ||
182 | if (!cpu_online(i)) { | ||
183 | break; | ||
184 | } | ||
185 | msecs--; | ||
186 | mdelay(1); | ||
187 | } | ||
188 | } | ||
189 | mb(); | ||
190 | } | ||
191 | #endif /* CONFIG_PPC_STD_MMU_64 */ | ||
192 | |||
193 | /* | 165 | /* |
194 | * This function will be called by secondary cpus or by kexec cpu | 166 | * This function will be called by secondary cpus or by kexec cpu |
195 | * if soft-reset is activated to stop some CPUs. | 167 | * if soft-reset is activated to stop some CPUs. |
@@ -234,7 +206,6 @@ void crash_kexec_secondary(struct pt_regs *regs) | |||
234 | } | 206 | } |
235 | 207 | ||
236 | #else /* ! CONFIG_SMP */ | 208 | #else /* ! CONFIG_SMP */ |
237 | static inline void crash_kexec_wait_realmode(int cpu) {} | ||
238 | 209 | ||
239 | static void crash_kexec_prepare_cpus(int cpu) | 210 | static void crash_kexec_prepare_cpus(int cpu) |
240 | { | 211 | { |
@@ -257,6 +228,36 @@ void crash_kexec_secondary(struct pt_regs *regs) | |||
257 | } | 228 | } |
258 | #endif /* CONFIG_SMP */ | 229 | #endif /* CONFIG_SMP */ |
259 | 230 | ||
231 | /* wait for all the CPUs to hit real mode but timeout if they don't come in */ | ||
232 | #if defined(CONFIG_SMP) && defined(CONFIG_PPC_STD_MMU_64) | ||
233 | static void crash_kexec_wait_realmode(int cpu) | ||
234 | { | ||
235 | unsigned int msecs; | ||
236 | int i; | ||
237 | |||
238 | msecs = 10000; | ||
239 | for (i=0; i < NR_CPUS && msecs > 0; i++) { | ||
240 | if (i == cpu) | ||
241 | continue; | ||
242 | |||
243 | while (paca[i].kexec_state < KEXEC_STATE_REAL_MODE) { | ||
244 | barrier(); | ||
245 | if (!cpu_possible(i)) { | ||
246 | break; | ||
247 | } | ||
248 | if (!cpu_online(i)) { | ||
249 | break; | ||
250 | } | ||
251 | msecs--; | ||
252 | mdelay(1); | ||
253 | } | ||
254 | } | ||
255 | mb(); | ||
256 | } | ||
257 | #else | ||
258 | static inline void crash_kexec_wait_realmode(int cpu) {} | ||
259 | #endif /* CONFIG_SMP && CONFIG_PPC_STD_MMU_64 */ | ||
260 | |||
260 | /* | 261 | /* |
261 | * Register a function to be called on shutdown. Only use this if you | 262 | * Register a function to be called on shutdown. Only use this if you |
262 | * can't reset your device in the second kernel. | 263 | * can't reset your device in the second kernel. |