aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/prom.c
diff options
context:
space:
mode:
authorGravatar Laurent Dufour <ldufour@linux.ibm.com> 2022-11-10 19:06:18 +0100
committerGravatar Michael Ellerman <mpe@ellerman.id.au> 2022-12-07 20:14:49 +1100
commite13d23a404f2e6dfaf8b1ef7d161a0836fce4fa5 (patch)
tree0d093ffe5eee8a241016486c009de03282c92e04 /arch/powerpc/kernel/prom.c
parentpowerpc/cpuidle: Set CPUIDLE_FLAG_POLLING for snooze state (diff)
downloadlinux-e13d23a404f2e6dfaf8b1ef7d161a0836fce4fa5.tar.gz
linux-e13d23a404f2e6dfaf8b1ef7d161a0836fce4fa5.tar.bz2
linux-e13d23a404f2e6dfaf8b1ef7d161a0836fce4fa5.zip
powerpc: export the CPU node count
At boot time, the FDT is parsed to compute the number of CPUs. In addition count the number of CPU nodes and export it. This is useful when building the FDT for a kexeced kernel since we need to take in account the CPU node added since the boot time during CPU hotplug operations. Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20221110180619.15796-2-ldufour@linux.ibm.com
Diffstat (limited to 'arch/powerpc/kernel/prom.c')
-rw-r--r--arch/powerpc/kernel/prom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 1eed87d954ba..645f4450dfc3 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -72,6 +72,7 @@ int __initdata iommu_is_off;
int __initdata iommu_force_on;
unsigned long tce_alloc_start, tce_alloc_end;
u64 ppc64_rma_size;
+unsigned int boot_cpu_node_count __ro_after_init;
#endif
static phys_addr_t first_memblock_size;
static int __initdata boot_cpu_count;
@@ -335,6 +336,8 @@ static int __init early_init_dt_scan_cpus(unsigned long node,
if (type == NULL || strcmp(type, "cpu") != 0)
return 0;
+ boot_cpu_node_count++;
+
/* Get physical cpuid */
intserv = of_get_flat_dt_prop(node, "ibm,ppc-interrupt-server#s", &len);
if (!intserv)