Commit aafb9561 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: Make IPI receivers survive a late arrival after the sender has...

[PATCH] ppc64: Make IPI receivers survive a late arrival after the sender has given up waiting, from Olof Johansson

From: Anton Blanchard <anton@samba.org>

Make IPI receivers survive a late arrival after the sender has given up
waiting, from Olof Johansson
parent 69e3e272
...@@ -480,13 +480,13 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -480,13 +480,13 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
while (atomic_read(&data.started) != cpus) { while (atomic_read(&data.started) != cpus) {
HMT_low(); HMT_low();
if (--timeout == 0) { if (--timeout == 0) {
printk("smp_call_function on cpu %d: other cpus not "
"responding (%d)\n", smp_processor_id(),
atomic_read(&data.started));
#ifdef CONFIG_DEBUG_KERNEL #ifdef CONFIG_DEBUG_KERNEL
if (debugger) if (debugger)
debugger(0); debugger(0);
#endif #endif
printk("smp_call_function on cpu %d: other cpus not "
"responding (%d)\n", smp_processor_id(),
atomic_read(&data.started));
goto out; goto out;
} }
} }
...@@ -496,15 +496,15 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -496,15 +496,15 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
while (atomic_read(&data.finished) != cpus) { while (atomic_read(&data.finished) != cpus) {
HMT_low(); HMT_low();
if (--timeout == 0) { if (--timeout == 0) {
#ifdef CONFIG_DEBUG_KERNEL
if (debugger)
debugger(0);
#endif
printk("smp_call_function on cpu %d: other " printk("smp_call_function on cpu %d: other "
"cpus not finishing (%d/%d)\n", "cpus not finishing (%d/%d)\n",
smp_processor_id(), smp_processor_id(),
atomic_read(&data.finished), atomic_read(&data.finished),
atomic_read(&data.started)); atomic_read(&data.started));
#ifdef CONFIG_DEBUG_KERNEL
if (debugger)
debugger(0);
#endif
goto out; goto out;
} }
} }
...@@ -513,6 +513,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -513,6 +513,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
ret = 0; ret = 0;
out: out:
call_data = NULL;
HMT_medium(); HMT_medium();
spin_unlock(&call_lock); spin_unlock(&call_lock);
return ret; return ret;
...@@ -520,9 +521,19 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -520,9 +521,19 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
void smp_call_function_interrupt(void) void smp_call_function_interrupt(void)
{ {
void (*func) (void *info) = call_data->func; void (*func) (void *info);
void *info = call_data->info; void *info;
int wait = call_data->wait; int wait;
/* call_data will be NULL if the sender timed out while
* waiting on us to receive the call.
*/
if (!call_data)
return;
func = call_data->func;
info = call_data->info;
wait = call_data->wait;
/* /*
* Notify initiating CPU that I've grabbed the data and am * Notify initiating CPU that I've grabbed the data and am
......
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