Re: [PATCH v6 2/4] MIPS: Skip generic IPI setup for platform-specific callbacks
From: Paul Cercueil
Date: Mon Nov 16 2026 - 11:07:16 EST
Le vendredi 13 novembre 2026 à 11:08 -0800, Florian Fainelli a écrit :
> A generic MIPS kernel can select a platform SMP backend with direct IPI
> callbacks instead of an IPI IRQ domain. The XBurst backend uses CP0
> mailboxes, so generic IPI allocation would find no domain and BUG when
> more than one CPU is present.
>
> Skip generic IPI initialization when neither selected send callback uses
> the generic implementation. Keep initialization when either callback
> uses generic IRQ IPIs, and retain the existing single-CPU shortcut.
>
> Sashiko AI reported the XBurst integration issue; Codex assisted with
> the change and extracted-function/build checks.
>
> Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
Arg, I was reviewing the v5 and missed that you already sent the v6.
Anyway, LGTM.
Reviewed-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
Tested-by: Paul Cercueil <paul@xxxxxxxxxxxxxxx>
Cheers,
-Paul
> ---
> Changes in v6:
>
> - addded missing Signed-off-by tag
>
> Changes since previous posting:
> - Split the generic IPI initialization guard out of the XBurst SMP patch
> as a prerequisite, as requested by Paul Cercueil.
> - Add braces around the multi-line condition.
>
> arch/mips/kernel/smp.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/smp.c b/arch/mips/kernel/smp.c
> index 0f28b4a62e72..086298146dd8 100644
> --- a/arch/mips/kernel/smp.c
> +++ b/arch/mips/kernel/smp.c
> @@ -338,8 +338,12 @@ int mips_smp_ipi_free(const struct cpumask *mask)
>
> static int __init mips_smp_ipi_init(void)
> {
> - if (num_possible_cpus() == 1)
> + /* Platforms with their own IPI callbacks do not need an IRQ domain.
> */
> + if ((mp_ops->send_ipi_single != mips_smp_send_ipi_single &&
> + mp_ops->send_ipi_mask != mips_smp_send_ipi_mask) ||
> + num_possible_cpus() == 1) {
> return 0;
> + }
>
> mips_smp_ipi_allocate(cpu_possible_mask);
>