Re: [PATCH 9/9] ARM: mstar: SMP support

From: Arnd Bergmann
Date: Mon Nov 30 2020 - 08:43:40 EST


On Mon, Nov 30, 2020 at 2:10 PM Daniel Palmer <daniel@xxxxxxxx> wrote:

> +#ifdef CONFIG_SMP
> +static int mstarv7_boot_secondary(unsigned int cpu, struct task_struct *idle)
> +{
> + struct device_node *np;
> + u32 bootaddr = (u32) __pa_symbol(secondary_startup_arm);
> + void __iomem *smpctrl = 0;

The initialization is wrong here: it's not a pointer and the value '0'
is not useful.

> +struct smp_operations __initdata mstarv7_smp_ops = {
> + .smp_boot_secondary = mstarv7_boot_secondary,
> +};
> +#endif

So no hotplug operations?

> @@ -78,4 +125,7 @@ static void __init mstarv7_init(void)
> DT_MACHINE_START(MSTARV7_DT, "MStar/Sigmastar Armv7 (Device Tree)")
> .dt_compat = mstarv7_board_dt_compat,
> .init_machine = mstarv7_init,
> +#ifdef CONFIG_SMP
> + .smp = smp_ops(mstarv7_smp_ops),
> +#endif
> MACHINE_END

Drop the #ifdef, smp_ops() already makes the assignment conditional.

Or better, use CPU_METHOD_OF_DECLARE() instead of smp_ops.

Arnd