diff options
author | Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> | 2006-10-27 06:49:53 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2006-10-31 17:17:27 -0500 |
commit | 5ee7737379b1d7f0c977c0f1661fbaf01a8d4721 (patch) | |
tree | 9a6c4d4a0bf94d5b586e60710a19addda2bcf2b0 /arch/ia64 | |
parent | f2454a1a4b2aca38d3b7887619f43291d773c1ee (diff) |
[IA64] cpu-hotplug: Fixing confliction between CPU hot-add and IPI
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/smp.c | 10 |
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 | |||
328 | smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) | 328 | smp_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); |