[PATCH] arm64: kernel: smp: ignore disabled cpu node

From: Peng Fan (OSS)
Date: Wed Apr 19 2023 - 05:36:14 EST


From: Peng Fan <peng.fan@xxxxxxx>

If the cpu node is set disabled in device tree, we should ignore the
node. i.MX8MP has some variants, which have one or two or four A53 cores.
The current imx8mp device tree use the full feature SoC. With such
device tree to bring the variant with one or two A53 cores will cause
issue.

The firmware will update the status property, and kernel will check the
property before bring up the core.

Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
---
arch/arm64/kernel/smp.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index d00d4cbb31b1..aa1d678adf4a 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -631,6 +631,9 @@ static void __init of_parse_and_init_cpus(void)
for_each_of_cpu_node(dn) {
u64 hwid = of_get_cpu_hwid(dn, 0);

+ if (!of_device_is_available(dn))
+ goto next;
+
if (hwid & ~MPIDR_HWID_BITMASK)
goto next;

--
2.37.1