From 94873eb2c7cc1dd29b4c350422bc510686db1fd1 Mon Sep 17 00:00:00 2001 From: Kenji Kaneshige Date: Fri, 27 Oct 2006 19:49:53 +0900 Subject: [PATCH] --- yaml --- r: 40563 b: refs/heads/master c: 5ee7737379b1d7f0c977c0f1661fbaf01a8d4721 h: refs/heads/master i: 40561: be05f7ddd59545d0b5d9dc5a464d4e58202f9343 40559: c798b6768c27266fa31a55668114c898ee10bcee v: v3 --- [refs] | 2 +- trunk/arch/ia64/kernel/smp.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 90ec2012aa6d..344e14b363c4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2454a1a4b2aca38d3b7887619f43291d773c1ee +refs/heads/master: 5ee7737379b1d7f0c977c0f1661fbaf01a8d4721 diff --git a/trunk/arch/ia64/kernel/smp.c b/trunk/arch/ia64/kernel/smp.c index 657ac99a451c..2763e7917781 100644 --- a/trunk/arch/ia64/kernel/smp.c +++ b/trunk/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);