[PATCH v2 15/53] MIPS: SGI-IP27: put a Bedrock hub's boot CPU in slot 0
From: Imre Kaloz
Date: Tue Oct 13 2026 - 10:32:51 EST
ip27_smp_setup() takes CPU 0 to be the boot CPU. On a Bedrock hub, swap
the boot CPU's sn_cpu_info[] entry, found by nasid and PI_CPU_NUM slice,
into slot 0, and give slot 0 master_nasid. The PROM's virtids run
densely from 0 in board-list order and so match the table's slots.
Signed-off-by: Imre Kaloz <kaloz@xxxxxxxxxx>
---
arch/mips/sgi-ip27/ip27-smp.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index 62733e049570..d49766cffd12 100644
--- a/arch/mips/sgi-ip27/ip27-smp.c
+++ b/arch/mips/sgi-ip27/ip27-smp.c
@@ -80,6 +80,15 @@ void cpu_node_probe(void)
highest = node_scan_cpus(nasid, highest);
}
+ /* The boot CPU must be CPU 0 wherever the board list puts it. */
+ for (i = 1; system_is_ip35 && i <= highest; i++) {
+ if (cputonasid(i) == master_nasid &&
+ cputoslice(i) == LOCAL_HUB_L(PI_CPU_NUM)) {
+ swap(sn_cpu_info[0], sn_cpu_info[i]);
+ break;
+ }
+ }
+
printk("Discovered %d cpus on %d nodes\n", highest + 1, num_online_nodes());
}
@@ -168,9 +177,9 @@ static void __init ip27_smp_setup(void)
replicate_kernel_text();
/*
- * PROM sets up system, that boot cpu is always first CPU on nasid 0
+ * The boot CPU is CPU 0, on the node it booted from
*/
- cputonasid(0) = 0;
+ cputonasid(0) = master_nasid;
cputoslice(0) = LOCAL_HUB_L(PI_CPU_NUM);
}
--
2.47.3