[PATCH v5 2/4] MIPS: Skip generic IPI setup for platform-specific callbacks
From: Florian Fainelli
Date: Fri Nov 13 2026 - 15:53:53 EST
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.
---
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);