[PATCH 10/38] MIPS: SGI-IP27: put a Bedrock hub's boot CPU in slot 0
From: Imre Kaloz
Date: Thu Oct 01 2026 - 12:57:44 EST
ip27_smp_setup() takes CPU 0 to be the boot CPU. On a Bedrock hub, find
the boot CPU's sn_cpu_info[] entry by its nasid and PI_CPU_NUM slice and
swap it into slot 0. The PROM's virtids, which set the possible mask, 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 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/mips/sgi-ip27/ip27-smp.c b/arch/mips/sgi-ip27/ip27-smp.c
index 62733e049570..159dbd6ddda8 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());
}
--
2.47.3