Commit 5ee77373 authored by Kenji Kaneshige's avatar Kenji Kaneshige Committed by Tony Luck

[IA64] cpu-hotplug: Fixing confliction between CPU hot-add and IPI

Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: default avatarSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent f2454a1a
...@@ -328,10 +328,14 @@ int ...@@ -328,10 +328,14 @@ int
smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait)
{ {
struct call_data_struct data; 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; return 0;
}
/* Can deadlock when called with interrupts disabled */ /* Can deadlock when called with interrupts disabled */
WARN_ON(irqs_disabled()); WARN_ON(irqs_disabled());
...@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai ...@@ -343,8 +347,6 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wai
if (wait) if (wait)
atomic_set(&data.finished, 0); atomic_set(&data.finished, 0);
spin_lock(&call_lock);
call_data = &data; call_data = &data;
mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */ mb(); /* ensure store to call_data precedes setting of IPI_CALL_FUNC */
send_IPI_allbutself(IPI_CALL_FUNC); send_IPI_allbutself(IPI_CALL_FUNC);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment