--- zzzz-none-000/linux-2.6.19.2/arch/ia64/kernel/smp.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/arch/ia64/kernel/smp.c 2007-01-11 07:38:19.000000000 +0000 @@ -108,7 +108,7 @@ } irqreturn_t -handle_IPI (int irq, void *dev_id) +handle_IPI (int irq, void *dev_id, struct pt_regs *regs) { int this_cpu = get_cpu(); unsigned long *pending_ipis = &__ia64_per_cpu_var(ipi_operation); @@ -328,14 +328,10 @@ smp_call_function (void (*func) (void *info), void *info, int nonatomic, int wait) { struct call_data_struct data; - int cpus; + int cpus = num_online_cpus()-1; - spin_lock(&call_lock); - cpus = num_online_cpus() - 1; - if (!cpus) { - spin_unlock(&call_lock); + if (!cpus) return 0; - } /* Can deadlock when called with interrupts disabled */ WARN_ON(irqs_disabled()); @@ -347,6 +343,8 @@ 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);