Re: [PATCH 2/2] ARM: bcm: support more than two CPUs on BCMBCA
From: Linus Walleij
Date: Tue Dec 01 2026 - 08:49:05 EST
Hi Jie,
On Thu, Nov 26, 2026 at 4:06 AM Jie Feng <hjf3108@xxxxxxxxx> wrote:
> This is obtained from the vendor source code where there is also a holding pen:
> https://github.com/Asuswrt-Merlin/asuswrt-merlin.ng/blob/main/release/src-rt-5.04axhnd.675x/kernel/linux-4.19/arch/arm/plat-bcm63xx/platsmp.c
> https://github.com/Asuswrt-Merlin/asuswrt-merlin.ng/blob/main/release/src-rt-5.04axhnd.675x/kernel/linux-4.19/arch/arm/plat-bcm63xx/plat-ca9mp-headsmp.S
(...)
> > > @@ -58,17 +76,27 @@ static int bcmbca_boot_secondary(unsigned int cpu, struct task_struct *idle)
> > > /*
> > > * The CFE stub reads GPIO GeneralPurpose after an interrupt and
> > > * branches to it in ARM state. Clear any Thumb function pointer
> > > - * tag and complete the MMIO write before sending the wakeup IPI.
> > > + * tag and complete the MMIO write before opening the pen and
> > > + * sending the wakeup IPI.
> > > */
> > > - writel(__pa_symbol(secondary_startup_arm) & ~1, mailbox);
> > > + writel(__pa_symbol(bcmbca_secondary_startup) & ~1, mailbox);
> > > dsb(sy);
> > > - arch_send_wakeup_ipi_mask(cpumask_of(cpu));
> >
> > Have you actually tested *not* changing this code and see if
> > all CPUs just come up? It should just send each CPU in order to
> > secondary_startup_arm like we want?
> I traced the code to drivers/irqchip/irq-gic.c, since
> arch_send_wakeup_ipi_mask will eventually end up there.
Yes? And it wakes up the secondary core targeted by that IPI,
right?
> Since this platform is booted by the CFE and not using PSCI, I decided
> to use the vendor source code since it looks like the safest option.
Don't trust the vendor code. The vendor code has signs of cargo-cult
programming, and you are carrying it further.
https://en.wikipedia.org/wiki/Cargo_cult_programming
Try my approach instead.
If you don't understand what I want you to try I can send
a patch for you to test.
Yours,
Linus Walleij