From patchwork Wed Apr 24 17:28:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 2485531 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id AC9E3DF25A for ; Wed, 24 Apr 2013 17:30:46 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV3VQ-0003mE-FY; Wed, 24 Apr 2013 17:29:21 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV3Ur-0007Er-Bw; Wed, 24 Apr 2013 17:28:45 +0000 Received: from service87.mimecast.com ([91.220.42.44]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UV3Uo-0007E6-FB for linux-arm-kernel@lists.infradead.org; Wed, 24 Apr 2013 17:28:43 +0000 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 24 Apr 2013 18:28:40 +0100 Received: from e102568-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 24 Apr 2013 18:28:37 +0100 From: Lorenzo Pieralisi To: linux-arm-kernel@lists.infradead.org, devicetree-discuss@lists.ozlabs.org Subject: [RFC PATCH v3 01/17] ARM: DT: kernel: move temporary cpu map stack array to static data Date: Wed, 24 Apr 2013 18:28:06 +0100 Message-Id: <1366824502-19729-2-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 1.7.12 In-Reply-To: <1366824502-19729-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1366824502-19729-1-git-send-email-lorenzo.pieralisi@arm.com> X-OriginalArrivalTime: 24 Apr 2013 17:28:37.0872 (UTC) FILETIME=[27D31F00:01CE4111] X-MC-Unique: 113042418284001701 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130424_132842_739919_B5B68989 X-CRM114-Status: GOOD ( 13.07 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [91.220.42.44 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Nicolas Pitre , Jon Medhurst , Dave Martin , Andrew Lunn , Tony Lindgren , Benjamin Herrenschmidt , Linus Walleij , Will Deacon , Viresh Kumar , Kukjin Kim , Mark Rutland , Lennert Buytenhek , Lorenzo Pieralisi , Russell King , Magnus Damm , Catalin Marinas , Grant Likely , David Brown , Jean-Christophe Plagniol-Villard , Dinh Nguyen , Arnd Bergmann , Stephen Warren , Sekhar Nori , Rob Herring , Simon Horman , Barry Song , Vincent Guittot , Vinayak Kale , Amit Kucheria , Nicolas Ferre , Olof Johansson , Maxime Ripard , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- arch/arm/kernel/devtree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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");