Re: [patch v2 21/35] Hexagon: Add SMP support

Joe Perches
2011-08-30T19:30:39Z

On Tue, 2011-08-30 at 14:07 -0500, Richard Kuo wrote:
> plain text document attachment (smp.diff)
> Signed-off-by: Richard Kuo <rkuo@codeaurora.org>
[]
> +static inline void __handle_ipi(unsigned long *ops, struct ipi_data *ipi,
> + int cpu)
> +{
> + do {
> + unsigned long msg = msg = ffz(~*ops);

Really? That's unlikely to be the right code.
Maybe just one msg?

> +
> + *ops &= ~(1 << msg);
> +
> + switch (msg) {
> + case IPI_TIMER:
> + ipi_timer();
> + break;
> + case IPI_CALL_FUNC:
> + {

> + struct smp_call_struct *data =
> + smp_call_function_data;
> + void (*func) (void *info) =
> + data->func;

No need to wrap either of these.

> + void *info = data->info;
> + int wait = data->wait;
> +
> + smp_mb();
> + cpumask_clear_cpu(cpu, &data->pending);
> +
> + (*func)(info);
> +
> + smp_mb();
> + if (wait)
> + cpumask_clear_cpu(cpu,
> + &data->unfinished);

or here.