summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>2006-10-27 12:49:53 +0200
committerTony Luck <tony.luck@intel.com>2006-10-31 23:17:27 +0100
commit5ee7737379b1d7f0c977c0f1661fbaf01a8d4721 (patch)
tree9a6c4d4a0bf94d5b586e60710a19addda2bcf2b0 /arch
parent[IA64] don't double >> PAGE_SHIFT pointer for /dev/kmem access (diff)
downloadlinux-5ee7737379b1d7f0c977c0f1661fbaf01a8d4721.tar.xz
linux-5ee7737379b1d7f0c977c0f1661fbaf01a8d4721.zip
[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')
-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
smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait)
{
struct call_data_struct data;
- int cpus = num_online_cpus()-1;
+ int cpus;
- if (!cpus)
+ spin_lock(&call_lock);
+ cpus = num_online_cpus() - 1;
+ if (!cpus) {
+ spin_unlock(&call_lock);
return 0;
+ }
/* Can deadlock when called with interrupts disabled */
WARN_ON(irqs_disabled());
@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
if (wait)
atomic_set(&data.finished, 0);
- spin_lock(&call_lock);
-
call_data = &data;
mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
send_IPI_allbutself(IPI_CALL_FUNC);