From patchwork Thu May 16 15:34:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Pieralisi X-Patchwork-Id: 2579271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id C25514020A for ; Thu, 16 May 2013 16:41:07 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud0kr-0006gn-5O; Thu, 16 May 2013 16:10:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud0ko-00085d-Tz; Thu, 16 May 2013 16:10:06 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud0kl-00085I-Hf for linux-arm-kernel@merlin.infradead.org; Thu, 16 May 2013 16:10:04 +0000 Received: from fw-tnat.cambridge.arm.com ([217.140.96.21] helo=cam-smtp0.cambridge.arm.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ud0kg-0003DD-RV for linux-arm-kernel@lists.infradead.org; Thu, 16 May 2013 16:10:00 +0000 Received: from geoffrey.Emea.Arm.com (geoffrey.emea.arm.com [10.1.255.46]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id r4GFYCjh001861; Thu, 16 May 2013 16:34:12 +0100 Received: from cam-owa2.Emea.Arm.com ([10.1.105.18]) by geoffrey.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 16 May 2013 16:34:12 +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); Thu, 16 May 2013 16:34:11 +0100 From: Lorenzo Pieralisi To: linux@arm.linux.org.uk, rob.herring@calxeda.com Subject: [PATCH 1/3] ARM: DT: kernel: move temporary cpu map stack array to static data Date: Thu, 16 May 2013 16:34:05 +0100 Message-Id: <1368718447-19209-2-git-send-email-lorenzo.pieralisi@arm.com> X-Mailer: git-send-email 1.8.2.2 In-Reply-To: <1368718447-19209-1-git-send-email-lorenzo.pieralisi@arm.com> References: <1368718447-19209-1-git-send-email-lorenzo.pieralisi@arm.com> X-OriginalArrivalTime: 16 May 2013 15:34:11.0877 (UTC) FILETIME=[D075ED50:01CE524A] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130516_120959_247864_8D44FA33 X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -1.3 (-) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-1.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [217.140.96.21 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.6 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: devicetree-discuss@lists.ozlabs.org, Lorenzo Pieralisi , linux-arm-kernel@lists.infradead.org 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 5af04f6..3d652e4f 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");