From patchwork Sat Jan 11 00:03:58 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Peddell X-Patchwork-Id: 3470681 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 85B389F169 for ; Sun, 12 Jan 2014 00:08:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 971A920160 for ; Sun, 12 Jan 2014 00:08:19 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 685A820123 for ; Sun, 12 Jan 2014 00:08:18 +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 1W28b5-0005wN-Ve; Sun, 12 Jan 2014 00:08:12 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W28b3-0003gj-HU; Sun, 12 Jan 2014 00:08:09 +0000 Received: from icp-osb-irony-out9.external.iinet.net.au ([203.59.1.226]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1W28ay-0003gI-KN for linux-arm-kernel@lists.infradead.org; Sun, 12 Jan 2014 00:08:07 +0000 Message-Id: <0a923e$51mtvt@icp-osb-irony-out9.iinet.net.au> X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApcFADnc0VI6Bsjc/2dsb2JhbABaKYJigzqlTgGRbIEHFnSDJRgQgSmIA8NlLY4NZB2CZ4E6BJ5vFAOLJoM/KoEs X-IronPort-AV: E=Sophos;i="4.95,645,1384272000"; d="scan'208";a="169572349" Received: from unknown (HELO lurch) ([58.6.200.220]) by icp-osb-irony-out9.iinet.net.au with SMTP; 12 Jan 2014 08:07:27 +0800 Received: by lurch (sSMTP sendmail emulation); Sun, 12 Jan 2014 10:07:05 +1000 From: klightspeed@killerwolves.net To: linux-arm-kernel@lists.infradead.org Date: Sat, 11 Jan 2014 10:03:58 +1000 Subject: [PATCH] ARM: Fix incorrect FDT initrd parameter override X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140111_190805_059113_8B8CE65B X-CRM114-Status: UNSURE ( 8.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.6 (/) Cc: devicetree@vger.kernel.org, klightspeed@killerwolves.net 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 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DATE_IN_PAST_24_48, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit 65939301acdb (arm: set initrd_start/initrd_end for fdt scan) caused the FDT initrd_start and initrd_end to override the phys_initrd_start and phys_initrd_size set by the initrd= kernel parameter. With this patch initrd_start and initrd_end will be overridden if phys_initrd_start and phys_initrd_size are set by the kernel initrd= parameter. Signed-off-by: Ben Peddell Acked-by: Jason Cooper --- arch/arm/mm/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 1f7b19a..819c539 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -345,10 +345,11 @@ void __init arm_memblock_init(struct meminfo *mi, #endif #ifdef CONFIG_BLK_DEV_INITRD /* FDT scan will populate initrd_start */ - if (initrd_start) { + if (initrd_start && !phys_initrd_size) { phys_initrd_start = __virt_to_phys(initrd_start); phys_initrd_size = initrd_end - initrd_start; } + initrd_start = initrd_end = 0; if (phys_initrd_size && !memblock_is_region_memory(phys_initrd_start, phys_initrd_size)) { pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n",