Commit 25da13c0 authored by Anton Blanchard's avatar Anton Blanchard

ppc64: use generic debugger hooks in smp_call_function, busy loop instead of udelay

parent f2febd06
...@@ -456,6 +456,10 @@ unsigned long get_wchan(struct task_struct *p) ...@@ -456,6 +456,10 @@ unsigned long get_wchan(struct task_struct *p)
return 0; return 0;
if (count > 0) { if (count > 0) {
ip = *(unsigned long *)(sp + 16); ip = *(unsigned long *)(sp + 16);
/*
* XXX we mask the upper 32 bits until procps
* gets fixed.
*/
if (ip < first_sched || ip >= last_sched) if (ip < first_sched || ip >= last_sched)
return (ip & 0xFFFFFFFF); return (ip & 0xFFFFFFFF);
} }
......
/* /*
*
*
* SMP support for ppc. * SMP support for ppc.
* *
* Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great * Written by Cort Dougan (cort@cs.nmt.edu) borrowing a great
...@@ -449,6 +447,9 @@ static struct call_data_struct { ...@@ -449,6 +447,9 @@ static struct call_data_struct {
int wait; int wait;
} *call_data; } *call_data;
/* delay of at least 8 seconds on 1GHz cpu */
#define SMP_CALL_TIMEOUT (1UL << (30 + 3))
/* /*
* This function sends a 'generic call function' IPI to all other CPUs * This function sends a 'generic call function' IPI to all other CPUs
* in the system. * in the system.
...@@ -469,7 +470,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -469,7 +470,7 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
{ {
struct call_data_struct data; struct call_data_struct data;
int ret = -1, cpus = num_online_cpus()-1; int ret = -1, cpus = num_online_cpus()-1;
int timeout; unsigned long timeout;
if (!cpus) if (!cpus)
return 0; return 0;
...@@ -483,47 +484,44 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic, ...@@ -483,47 +484,44 @@ int smp_call_function (void (*func) (void *info), void *info, int nonatomic,
spin_lock(&call_lock); spin_lock(&call_lock);
call_data = &data; call_data = &data;
wmb();
/* Send a message to all other CPUs and wait for them to respond */ /* Send a message to all other CPUs and wait for them to respond */
smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION, 0, 0); smp_message_pass(MSG_ALL_BUT_SELF, PPC_MSG_CALL_FUNCTION, 0, 0);
/* Wait for response */ /* Wait for response */
timeout = 8000000; timeout = SMP_CALL_TIMEOUT;
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", if (debugger)
smp_processor_id(), atomic_read(&data.started)); debugger(0);
#ifdef CONFIG_XMON printk("smp_call_function on cpu %d: other cpus not "
xmon(0); "responding (%d)\n", smp_processor_id(),
#endif atomic_read(&data.started));
#ifdef CONFIG_PPC_ISERIES
HvCall_terminateMachineSrc();
#endif
goto out; goto out;
} }
barrier();
udelay(1);
} }
if (wait) { if (wait) {
timeout = 1000000; timeout = SMP_CALL_TIMEOUT;
while (atomic_read(&data.finished) != cpus) { while (atomic_read(&data.finished) != cpus) {
HMT_low(); HMT_low();
if (--timeout == 0) { if (--timeout == 0) {
printk("smp_call_function on cpu %d: other cpus not finishing (%d/%d)\n", if (debugger)
smp_processor_id(), atomic_read(&data.finished), atomic_read(&data.started)); debugger(0);
#ifdef CONFIG_PPC_ISERIES printk("smp_call_function on cpu %d: other "
HvCall_terminateMachineSrc(); "cpus not finishing (%d/%d)\n",
#endif smp_processor_id(),
atomic_read(&data.finished),
atomic_read(&data.started));
goto out; goto out;
} }
barrier();
udelay(1);
} }
} }
ret = 0; ret = 0;
out: out:
HMT_medium(); HMT_medium();
spin_unlock(&call_lock); spin_unlock(&call_lock);
return ret; return ret;
......
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