aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kernel/smp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/ia64/kernel/smp.c b/arch/ia64/kernel/smp.c
index 657ac99a451c..2763e7917781 100644
--- a/arch/ia64/kernel/smp.c
+++ b/arch/ia64/kernel/smp.c
@@ -328,10 +328,14 @@ int
328smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) 328smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait)
329{ 329{
330 struct call_data_struct data; 330 struct call_data_struct data;
331 int cpus = num_online_cpus()-1; 331 int cpus;
332 332
333 if (!cpus) 333 spin_lock(&call_lock);
334 cpus = num_online_cpus() - 1;
335 if (!cpus) {
336 spin_unlock(&call_lock);
334 return 0; 337 return 0;
338 }
335 339
336 /* Can deadlock when called with interrupts disabled */ 340 /* Can deadlock when called with interrupts disabled */
337 WARN_ON(irqs_disabled()); 341 WARN_ON(irqs_disabled());
@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
343 if (wait) 347 if (wait)
344 atomic_set(&data.finished, 0); 348 atomic_set(&data.finished, 0);
345 349
346 spin_lock(&call_lock);
347
348 call_data = &data; 350 call_data = &data;
349 mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */ 351 mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
350 send_IPI_allbutself(IPI_CALL_FUNC); 352 send_IPI_allbutself(IPI_CALL_FUNC);