Re: [PATCH v3] ARM: npcm: Add CPU hotplug callbacks for kexec support

From: William A. Kennington III

Date: Fri Dec 04 2026 - 18:14:06 EST


On Thu, Dec 03, 2026 at 08:17:31PM +0200, Tomer Maimon wrote:
> Hi William,
>
> Sorry for the late reply, and thanks for updating the patch.
> What workflow are you looking to enable with kexec on NPCM7xx? It
> would help to understand where a normal reboot isn't sufficient.

The primary use case is kdump. Even for crash dumps, kexec -p goes
through machine_kexec_prepare(), which fails with -EINVAL on SMP ARM
platforms that do not implement CPU hotplug callbacks. A normal reboot
loses the crashed kernel's memory state instead of letting a crash
kernel boot and save a vmcore.

We don't need regular kexec over a normal reboot in production; kdump is
the real motivation. Rather than resending the old v2 WFI stub (which
leaves CPU1 stuck in kernel text and breaks CPU hotplug and full kexec),
it turned out to be straightforward to hand CPU1 back to the boot ROM
and make full kexec and CPU hotplug work properly.

> Have you tested repeated CPU1 offline/online cycles and a kexec into a
> second kernel that successfully brings CPU1 online?

Yes, I tested this v3 patch on an NPCM730 board running Linux 7.3.6:

- CPU1 offline/online: 20 cycles before kexec and 50 cycles after kexec,
with 0 failures. On each offline, SCRPAD transitioned to the boot ROM
parking address (0xffff0218) and CPU1 came back online cleanly. (An
earlier revision of the ROM-parking path also passed 200 cycles under
load.)
- SMP kexec: loaded the same 7.3.6 kernel with live /sys/firmware/fdt
and initrd via kexec -l and ran kexec -e. The second kernel booted
cleanly with both CPUs online ("smp: Brought up 1 node, 2 CPUs") and
then passed the 50 post-kexec CPU1 hotplug cycles.
- kdump: loaded a crash kernel with kexec -p, triggered a panic via
sysrq, and captured a vmcore cleanly.

Thanks,
William