Message ID | 1366042402-8987-2-git-send-email-lorenzo.pieralisi@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c index 70f1bde..f149217 100644 --- a/arch/arm/kernel/devtree.c +++ b/arch/arm/kernel/devtree.c @@ -78,11 +78,12 @@ void __init arm_dt_init_cpu_maps(void) * contain a list of MPIDR[23:0] values where MPIDR[31:24] must * read as 0. */ + static u32 tmp_map[NR_CPUS] __initdata = { + [0 ... NR_CPUS-1] = UINT_MAX }; struct device_node *cpu, *cpus; u32 i, j, cpuidx = 1; u32 mpidr = is_smp() ? read_cpuid_mpidr() & MPIDR_HWID_BITMASK : 0; - u32 tmp_map[NR_CPUS] = { [0 ... NR_CPUS-1] = UINT_MAX }; bool bootcpu_valid = false; cpus = of_find_node_by_path("/cpus");
As the number of CPUs increase, the temporary array allocated on the stack in arm_dt_init_cpu_maps() can become too big and trigger stack issues. This patch moves the allocated memory to static __initdata so that stack data is not used anymore to allocate the temporary array. Memory is marked as __initdata since it need not be persistent after boot. Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> --- arch/arm/kernel/devtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)