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

From: Joe Perches
Date: Tue Aug 30 2011 - 15:30:40 EST


On Tue, 2011-08-30 at 14:07 -0500, Richard Kuo wrote:
> plain text document attachment (smp.diff)
> Signed-off-by: Richard Kuo <rkuo@xxxxxxxxxxxxxx>
[]
> +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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/