From patchwork Mon Nov 5 22:54:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993433 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A4zWh8zm"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="pXeH/wDq"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp6C62vlz9sDb for ; Tue, 6 Nov 2018 09:59:47 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=GwUg5/EP6ZEdxRGLhwyY+mHQGdMqcgSKJ7MVcZS7fu0=; b=A4zWh8zmfs7GubWTRY31o+BB9W /rvDDyP18wL1ZGlY2iQEJV7DXwsgCucFpMLAOSMr+MBOA9Cg+AtDnKBuGygdQzf4lypd5Q/wKNRtY 5oZYIy0ZbmxmBSdiH1r96o/D9nTwV3mVC655Tmmg6Q8ZKzV3GciFiwFdCdp7vrR8Cn6P9EItnntCl jZ+uHf5vlc1uQ4cfVNqo7Zu1QLXT+hCbcQH4TrNSCz6KX7Im7g3GYRvhofItbF3+cwAKSKTYm7U90 3sqTja2kWqmI5McFZLowE4Fj6LpV2M4V7Ybq6mD5+EPy8Z8zUJpYGhtvBjFtEAoWGmSmGUDlCqVr0 2gKbQbKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnqT-0001NE-Jg; Mon, 05 Nov 2018 22:59:45 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnot-0008CL-I5; Mon, 05 Nov 2018 22:58:09 +0000 Received: by mail-pf1-x442.google.com with SMTP id u13-v6so5144787pfm.4; Mon, 05 Nov 2018 14:57:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Z3usUwYojcwaU66hyFniYwIfMZmcaRKijdMd9ub5bn8=; b=pXeH/wDqkJgLGhHgT9KUWZ6VKBwAE+INwAnsSDMoGB+slAZB6aW/y/9/mmaW9ZJ2u1 3Oa2rQiDMv/poDzQ5cu1C7P0QUxezQfAcxew6pzjTQJCi7829LB+KW/3KR3dNY2aAUYt VETVviZeG/PHAeSSWL9rLP5gpEK9jsFVHK075O4TiX7knRniVbnSwDa/5eChQiCD8v1g +9W3ln64To6TWBQaAgvIMWH0/O+K5VR3drTdSRPtoUdPmfOt7KLFJdr942h3G0W4p6Xc k3Qa/TbFVPGOHLIsLhJCzrSY2627sQiWRtvhik3dd4a5IHDpDE81wXZ8fkn9/eVUH8wE R6cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Z3usUwYojcwaU66hyFniYwIfMZmcaRKijdMd9ub5bn8=; b=FeX2+Pns2qxQp5km+0niHaQruSfX8+9oa7OmgTpyQUuGOQ/T5USPhx40455u+O1K7g 598MecBdmAJLSvPnEnZ5+8zchHoHqi1yW7xu43mlHoBeUo5Xz0PZQ9ooFRizEOr4Zepx 9yKQWWPUANZnFJFQFz737F3ZUxcDf3XTTLYG08VckqdVSDt10rKoVsG6r6auVN2xFZDc SN0atT4pWj5Cyf+bXJ8/MzJF1Pd6ysTj14/lvCja73ic1bM2jqVQEgtzog1J/QOoDD93 3D+wZcRbNHwnkN4T1MB9GtdC+nWDihBD1G+kYxLZFDHEGvMNYooXUxTLnYXlYdajG8F5 j/Vg== X-Gm-Message-State: AGRZ1gKrThTMmIvWJZpUY+fkZMeY+zphMjwkXMWl9f/xaKXPYEu/YLAT VRss361tz8JGbsBhtmDxt7k= X-Google-Smtp-Source: AJdET5e1oLnAiMdQFa1Xjn43gKt+HOkE63wECR6J1MukkfBbLN+UMM6FQ1Ve48Kz/D7/KMVW6pZ89A== X-Received: by 2002:a63:f65:: with SMTP id 37mr15671257pgp.238.1541458676654; Mon, 05 Nov 2018 14:57:56 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.57.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:57:55 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 1/6] nds32: Remove phys_initrd_start and phys_initrd_size Date: Mon, 5 Nov 2018 14:54:26 -0800 Message-Id: <20181105225431.24485-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145807_611949_82E32C51 X-CRM114-Status: GOOD ( 12.05 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org This will conflict with a subsequent change making phys_initrd_start and phys_initrd_size global variables. nds32 does not make use of those nor provides a suitable declarations so just get rid of them. Signed-off-by: Florian Fainelli --- arch/nds32/mm/init.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/nds32/mm/init.c b/arch/nds32/mm/init.c index 131104bd2538..253f79fc7196 100644 --- a/arch/nds32/mm/init.c +++ b/arch/nds32/mm/init.c @@ -21,8 +21,6 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_SPINLOCK(anon_alias_lock); extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; -extern unsigned long phys_initrd_start; -extern unsigned long phys_initrd_size; /* * empty_zero_page is a special page that is used for From patchwork Mon Nov 5 22:54:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993430 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="u1oA96Zj"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CyP0IHV4"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp4x6Jsrz9sD4 for ; Tue, 6 Nov 2018 09:58:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yeKY4ABwnUhWDt1Xl0uvdTIsM8/TS/7YWadoVpex5K0=; b=u1oA96ZjjU9R0mqyJFH4cnYNRe GkJeE6X/C5dng4GUHXVLhv2+jgUzg0oIIlaWNq4+AJpTlohddi1cvsbY9/K4k9xCGjZnVU2hZ7mws uXAU34KITqzt3XykB6yT53zkdWjFHYjeJdJJGPxpCbRcgeUgdzWyvxasm5tBXl0F1dTazSfSl79TB JNWtazZ7zOJS+1QcqNoNJJ+3CVkVb1+NF611EIodDX9fT8r90DZgz630Z2b3olgTjo4WIDxkQdIdj jK/8mJncgTv32uGhlD9fvAiUYGW5PxjDJ8PxSPPbtA0bHNljT7+P+PK04XMA09fO8jrfq++cn6JhE /CMpf8KA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnpP-0000L8-Mg; Mon, 05 Nov 2018 22:58:39 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnoq-0008DI-4P; Mon, 05 Nov 2018 22:58:05 +0000 Received: by mail-pf1-x441.google.com with SMTP id j22-v6so5152565pfh.3; Mon, 05 Nov 2018 14:57:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=c8Lf7boHwRJXjni27D65zHCfVda/tTM6oSDLxd215Cs=; b=CyP0IHV4UZ15O/1av2PxKPc3fsM1dB9agK8a5/x5JbPuU8ehNbg93f2Z+H3p8P3exi AUysi1kvzZ/nzXqIkehj9x3Ty4dTQW1tZ2GiD9b1pDhZZhcQLbJBYft327OsaDdMCnda Ok0lC9+RrISTA0Gm2gsdkCQnOQ5EZc7azgT+1N9GydyYITmsfSwncHRfXsaMSz2+uGvc L2a8wReRvETau5kwO0UB9OCTE1M0zy8aFm9wXpj4c1y1OZ7bQkajvflID0pJmpJR9ruu /fO+Un/RWygfM+tHMG3jsuuVW0Dgp6S4GjVs77Y0YVYmTEH8FuFEH3t8NvQ2Sx5fU3mJ b6Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=c8Lf7boHwRJXjni27D65zHCfVda/tTM6oSDLxd215Cs=; b=lppHHQsrjjhdcd9etVkOSzxsaC7orBMkM53EOrUukzFSgVufnetyQOyPKSnrB+Wuyy /s7/verVo5ZvMcgCIFzskHpdNSIQnn0gED43BugfYzke/mYPDKaR9tif6jswxZVD2SOL SHcTl0qa52kvspsHc7I62wuzSjmX1zFsApOirEbgwuo1gC0YE7Vm5rm8DQwchSe8AY9H Jc7sHSOhIjGxsFtXV0cZIn0yVAyvW0Duvakq6HGhp3H5jbdKksiZcpYUwA/B/fhS+1vn M8uf1IzSHpcA+TsO+mxt9f1xHacaFayKmD9lfroPMz+t16KL+ngGdxiW9OOBtnCXIt/E N/Bw== X-Gm-Message-State: AGRZ1gJzpxCIjeidc4GB8CuEOibjkOXhNAyiE2i9A57Yf/JvrLDqUpan nXZqHDfu/ziwMhKbDUxESdY= X-Google-Smtp-Source: AJdET5dhuO49dXcbh8I0TtFMYPgWKi2MHznTTc59VzZ9ztIqA5GdnfEoAUgfNQ6fHDM39vsQv0cnNQ== X-Received: by 2002:a63:4c6:: with SMTP id 189mr21972247pge.391.1541458678847; Mon, 05 Nov 2018 14:57:58 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.57.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:57:58 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 2/6] arch: Make phys_initrd_start and phys_initrd_size global variables Date: Mon, 5 Nov 2018 14:54:27 -0800 Message-Id: <20181105225431.24485-3-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145804_201535_AC589631 X-CRM114-Status: GOOD ( 14.66 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Make phys_initrd_start and phys_initrd_size global variables declared in init/do_mounts_initrd.c such that we can later have generic code in drivers/of/fdt.c populate those variables for us. This requires both the ARM and unicore32 implementations to be properly guarded against CONFIG_BLK_DEV_INITRD, and also initialize the variables to the expected default values (unicore32). Signed-off-by: Florian Fainelli --- arch/arm/mm/init.c | 5 ++--- arch/unicore32/mm/init.c | 10 +++++++--- include/linux/initrd.h | 3 +++ init/do_mounts_initrd.c | 3 +++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 32e4845af2b6..438625764ccd 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -50,9 +50,7 @@ unsigned long __init __clear_cr(unsigned long mask) } #endif -static phys_addr_t phys_initrd_start __initdata = 0; -static unsigned long phys_initrd_size __initdata = 0; - +#ifdef CONFIG_BLK_DEV_INITRD static int __init early_initrd(char *p) { phys_addr_t start; @@ -89,6 +87,7 @@ static int __init parse_tag_initrd2(const struct tag *tag) } __tagtable(ATAG_INITRD2, parse_tag_initrd2); +#endif static void __init find_limits(unsigned long *min, unsigned long *max_low, unsigned long *max_high) diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index cf4eb9481fd6..02aa2c0b295e 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -30,9 +30,7 @@ #include "mm.h" -static unsigned long phys_initrd_start __initdata = 0x01000000; -static unsigned long phys_initrd_size __initdata = SZ_8M; - +#ifdef CONFIG_BLK_DEV_INITRD static int __init early_initrd(char *p) { unsigned long start, size; @@ -48,6 +46,7 @@ static int __init early_initrd(char *p) return 0; } early_param("initrd", early_initrd); +#endif /* * This keeps memory configuration data used by a couple memory @@ -156,6 +155,11 @@ void __init uc32_memblock_init(struct meminfo *mi) memblock_reserve(__pa(_text), _end - _text); #ifdef CONFIG_BLK_DEV_INITRD + if (!phys_initrd_size) { + phys_initrd_start = 0x01000000; + phys_initrd_size = SZ_8M; + } + if (phys_initrd_size) { memblock_reserve(phys_initrd_start, phys_initrd_size); diff --git a/include/linux/initrd.h b/include/linux/initrd.h index 84b423044088..14beaff9b445 100644 --- a/include/linux/initrd.h +++ b/include/linux/initrd.h @@ -21,4 +21,7 @@ extern int initrd_below_start_ok; extern unsigned long initrd_start, initrd_end; extern void free_initrd_mem(unsigned long, unsigned long); +extern phys_addr_t phys_initrd_start; +extern unsigned long phys_initrd_size; + extern unsigned int real_root_dev; diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index d1a5d885ce13..45865b72f4ea 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -16,6 +16,9 @@ int initrd_below_start_ok; unsigned int real_root_dev; /* do_proc_dointvec cannot handle kdev_t */ static int __initdata mount_initrd = 1; +phys_addr_t phys_initrd_start __initdata; +unsigned long phys_initrd_size __initdata; + static int __init no_initrd(char *str) { mount_initrd = 0; From patchwork Mon Nov 5 22:54:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993429 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="n8UHNrfi"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hX90kwsC"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp4x5nhVz9sCs for ; Tue, 6 Nov 2018 09:58:41 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Qn1It7h6ty6EBN2txOcNg61jcDWKqvs+6hAQCCXhXs8=; b=n8UHNrfiIG5sApQTXfCea1pATD 5hZQhfsXa9viBy+9DtfjKNkyNIXtGqnl79Yz9X+f0ICtwEns4CjwDBt9WafvSecWbRQ26vYS+NlQ1 RNjJBisZ2PoMENrQ8O3KDKWcPnd+kODgLQRokTXqpXWqc0YFIXQm2mxt+irLqM5b8MQsk9Z7YKIZ6 wP7BB+et0zuLMZP1O132f1sv957SNNfOqdxh39NushbKXg4INc2z7PQccRgow+8RTT4zb1Fl5jOW2 UR++0cOCz35jgOZLxDs4YpVAde6WCZabOhw26joyv90/kJ8RpBlHU09a5LGq3PBF4ulbdgUvS3Ljz KKOoGG8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnpP-0000Km-ES; Mon, 05 Nov 2018 22:58:39 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnoq-0008E7-4Q; Mon, 05 Nov 2018 22:58:05 +0000 Received: by mail-pf1-x441.google.com with SMTP id v68-v6so1550467pfk.0; Mon, 05 Nov 2018 14:58:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=VgNBTYXASvfvE5mN9VACuM5/lb+HR+nsTuMb/S+Z/g0=; b=hX90kwsCj0yrKIiMpZ7BbzUgcA+09UE+Q/W4vNMR20kYsZWoZMckYJyv7JHqrWnt0h yiicjwp2yWUN58TjC2wljlRC3YWfEdFxOutYgImI+8pt/4Y4YuMzhAUuVKrnl1lMu7DO m45W+18SbXGuIVsv6Be/vpptqn/ZWEmPpEoEcFz889hRt5PFxmw+AGVY/m/jdu0FbK4/ u/xI9ymccah/ZWD1atE+pQEpk8Xcu+j05VACYam/a1Y3eU5xUcpR6iyeXrp1GaBYSReJ sKSJZydJheJlVTo2LdUpp2V8JCXTFGiKWN/0OIDKbcxHf1CqDd9BHoQpf1L/4ods89vk 8BJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=VgNBTYXASvfvE5mN9VACuM5/lb+HR+nsTuMb/S+Z/g0=; b=NTuQQf70VKZoAwMNYStDiOln4615GJesxJpPbNlXGwaYLzR8+939YbEFykVlsi6nnm pW0vIif/DVY7pBhG4mJKyTqvO2q2P8weEyaOumMWJd9g2EV4MPg6Gcria+Xcd0Jmfr+i ctiF304KsNGtg+Hz1xmZq5iq8OwmoAe9UDaadoLb/YnVVGc/5rvw2irj7xBrwl8OUis2 R57XUdR/EoUFvFynW4Ai8nVqRBQ0SR8oLfAz19aHaF2WLk/rYmGCim4ermFqrdoB/9xf QYd6yB7PELELTJ8mr/g+hdjn+tS9ex9K/w3p6pUTiAghfUDfwSFElPoph0IN8PP54Li9 tUdg== X-Gm-Message-State: AGRZ1gJ2gpWX19a85L0ITo1RXbT9L3BO5XJmFg4foWuNVwxc6fkGctfy 4yuTUEXnVcALL+4wAFcYQyY= X-Google-Smtp-Source: AJdET5flPEUVa4DTrqrXuVeEonToqM7dth/czamRdKp+dc9s1CxfO+MpVIQ0+sNqncZFvhfk1QHf8Q== X-Received: by 2002:a63:ec12:: with SMTP id j18mr19677663pgh.200.1541458681454; Mon, 05 Nov 2018 14:58:01 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.57.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:58:00 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 3/6] of/fdt: Populate phys_initrd_start/phys_initrd_size from FDT Date: Mon, 5 Nov 2018 14:54:28 -0800 Message-Id: <20181105225431.24485-4-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145804_203503_E5AC69BF X-CRM114-Status: GOOD ( 12.77 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:441 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that we have central and global variables holding the physical address and size of the initrd, we can have early_init_dt_check_for_initrd() populate phys_initrd_start/phys_initrd_size for us. This allows us to remove a chunk of code from arch/arm/mm/init.c introduced with commit 65939301acdb ("arm: set initrd_start/initrd_end for fdt scan"). Signed-off-by: Florian Fainelli --- arch/arm/mm/init.c | 6 ------ drivers/of/fdt.c | 2 ++ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 438625764ccd..a3b6f1f1cbaf 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -235,12 +235,6 @@ static void __init arm_initrd_init(void) phys_addr_t start; unsigned long size; - /* FDT scan will populate 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) diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index bb532aae0d92..88760a0983a7 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -924,6 +924,8 @@ static void __init early_init_dt_check_for_initrd(unsigned long node) end = of_read_number(prop, len/4); __early_init_dt_declare_initrd(start, end); + phys_initrd_start = start; + phys_initrd_size = end - start; pr_debug("initrd_start=0x%llx initrd_end=0x%llx\n", (unsigned long long)start, (unsigned long long)end); From patchwork Mon Nov 5 22:54:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993435 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qhUpcGLh"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kDJEVAds"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp712ck1z9sDT for ; Tue, 6 Nov 2018 10:00:29 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=5dVqdjesGDJ+MBTQPMxrXnn2HubozZozdc8I1LARvdA=; b=qhUpcGLhi4gteN3FI9zSal5T6e tKXVlSiFp4KTYMgHiwCsGkHVDG/VYv1B5lvGp+hiHylWGFtTQhZHeSSDjD2kzUK5UGUMLJoWC5hZy 09aVFW6dTXiX4OE540TLsyjDF38OEPRzLUV/qZTj/m+zIHs7cz/5XH0UAiMRexLtdoP8SgnQDXDrO u+6POSyMSYUMNut5y92oQffgV6DGj9fsBKJ4n/Os+OLZW5AUsk38r75LZyMLoZike7uPUZke3l1Cn yQj9upUzu2FJqN+XIVW/o2X8P3moJgbGnkfKkUWeepbkknRb6zP+q7FLNa+GLYsG3lE2CDaEkDj3b Rs0r3dmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnr8-00036e-4S; Mon, 05 Nov 2018 23:00:26 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnp0-0008En-El; Mon, 05 Nov 2018 22:58:16 +0000 Received: by mail-pg1-x543.google.com with SMTP id w3-v6so4887221pgs.11; Mon, 05 Nov 2018 14:58:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7Vou5vVu4RKvAqs88jCWoihjXzu3Wlr6TO2JLowYDRM=; b=kDJEVAdsERwYIlX5+2Vrkqaj0BTN6p8aDefmLjKN5mbEGb+FBljef9xNHVvNFNrgTi Q/ZfbsmxXzcEnUC1VHDmsH19JmKFfglQScp+oUo+M0SFCgMdI6pOx9NFZk8bsZV8unLJ Ud1svpoLogycdF4H0r4zLTJ88pD1QvT2NpHb5pzNUu01xBUvKLN6MBBgLCU+MAntw9Ts EZes07bkorRQ2wJO1fx0eTKEndC1lmMj41fRXcepJAOh+GzqJSmR932FXSJqw4xu9vhQ UE9KizynXofvpcV9HEncqXKyJSwvO+SqtskYbau8AR9uj/aa5S7G6srBSZIPjqJt89HG Mwiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7Vou5vVu4RKvAqs88jCWoihjXzu3Wlr6TO2JLowYDRM=; b=FDBHkvqYL1qefCyiNzYSDdoketw9TwyFy4CV42bJ+qiJHqM9tHGjO2c/Pk16MCu90B SoqfZAzZ5mTqPhB9YDzX8dSsG7ZDIbgHbalL2IRrUvpTHHxevfpoZp1ZohICsK+OB5Ml 8LVVbyFFBoHTju9i4W3rlcTM6omDiIVVnLCBb8Z7nWPbKejB6YYbD683LGzo5VYVCx7D 0zxPaE6u/BauW5Rc50g3pWvwhvF/a4I0PP5K5mysp81FQHm3u6OogUJ1JCiV3Vmga39z puaKCSSo7nH806IOs62r1uDq+UN5+xpo20W49Hbz4+A1UOPArfywFTFkt36JybjE/xdC JP3g== X-Gm-Message-State: AGRZ1gLtPeKlrFe0hGX6On9QzZFines8L+mKbx8Nka5V8zxtcJXInbV/ JZyyXB1iN1pwjk1ztxUPgsc= X-Google-Smtp-Source: AJdET5ddyQGSqhxevM1e6bjyaRrdfkIWp7CNFVqSujcFoCbLvaIi7LmRdXKDg66XjYTAe4Fs8cYSFA== X-Received: by 2002:a63:6906:: with SMTP id e6mr21284110pgc.144.1541458683551; Mon, 05 Nov 2018 14:58:03 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.58.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:58:02 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 4/6] arm64: Utilize phys_initrd_start/phys_initrd_size Date: Mon, 5 Nov 2018 14:54:29 -0800 Message-Id: <20181105225431.24485-5-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145814_656377_90B920C5 X-CRM114-Status: GOOD ( 16.06 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ARM64 is the only architecture that re-defines __early_init_dt_declare_initrd() in order for that function to populate initrd_start/initrd_end with physical addresses instead of virtual addresses. Instead of having an override we can leverage drivers/of/fdt.c populating phys_initrd_start/phys_initrd_size to populate those variables for us. Signed-off-by: Florian Fainelli Acked-by: Will Deacon --- arch/arm64/mm/init.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index 9d9582cac6c4..a66ffcde5f13 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -71,8 +71,8 @@ static int __init early_initrd(char *p) if (*endp == ',') { size = memparse(endp + 1, NULL); - initrd_start = start; - initrd_end = start + size; + phys_initrd_start = start; + phys_initrd_size = size; } return 0; } @@ -407,14 +407,14 @@ void __init arm64_memblock_init(void) memblock_add(__pa_symbol(_text), (u64)(_end - _text)); } - if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && initrd_start) { + if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) { /* * Add back the memory we just removed if it results in the * initrd to become inaccessible via the linear mapping. * Otherwise, this is a no-op */ - u64 base = initrd_start & PAGE_MASK; - u64 size = PAGE_ALIGN(initrd_end) - base; + u64 base = phys_initrd_start & PAGE_MASK; + u64 size = PAGE_ALIGN(phys_initrd_size); /* * We can only add back the initrd memory if we don't end up @@ -458,15 +458,11 @@ void __init arm64_memblock_init(void) * pagetables with memblock. */ memblock_reserve(__pa_symbol(_text), _end - _text); -#ifdef CONFIG_BLK_DEV_INITRD - if (initrd_start) { - memblock_reserve(initrd_start, initrd_end - initrd_start); - + if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && phys_initrd_size) { /* the generic initrd code expects virtual addresses */ - initrd_start = __phys_to_virt(initrd_start); - initrd_end = __phys_to_virt(initrd_end); + initrd_start = __phys_to_virt(phys_initrd_start); + initrd_end = initrd_start + phys_initrd_size; } -#endif early_init_fdt_scan_reserved_mem(); From patchwork Mon Nov 5 22:54:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993434 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d/WRlExq"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d4ra9uBP"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp6F05Z5z9sDT for ; Tue, 6 Nov 2018 09:59:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8ZprUGO/30sm/N/J0PVoqyGbrVVyMpOf0yugaSC6PfI=; b=d/WRlExqdU3m3diup19nQrHo75 7It+Ls1zqrJHUyZGIoe6B34GiRHsi212vL/Dra7jhjF/8vlunBGtPGv166l7B4FuDipWIa7b7E17a dZMRlkB22iLGXe+hMO2DBKCf1O+GJRSKbOkOFV8Qvb4NhkPXCoya66CuokDvFDX/iORGP0crxvZms WC8Bwy5OwbkeGR5vq+geWi/ca7M8CIqOxWDg/hoawKC1jT7dhvqF8Yp69b52NV5rmcDvgKQbfmeIq xto3bIyNLa549CFAA7vCZHrhAD170EGynAlOb6PCPNenZbxP4G4cGYO8o8h49Ga4+laVIoqhN3aE7 fhdPEYeA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnqU-0001Nd-86; Mon, 05 Nov 2018 22:59:46 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnot-0008Fx-I9; Mon, 05 Nov 2018 22:58:09 +0000 Received: by mail-pf1-x442.google.com with SMTP id x2-v6so1055020pfm.7; Mon, 05 Nov 2018 14:58:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1qMAVSnywWT1jNzaP9Dz12jcC6XfF9pDAxMfxNaT2nA=; b=d4ra9uBPAAmaXzt9tx0OsjsWeY8LJMwuxLCAnpsrGxJq9R67gIIK2Ct6lTD94UTQO2 qNz1+j2vm+tSCqGB1YXfwA6a63vN8rbIAFU/wp1ZYejV4SNcCFz3F03Ip3vNb5SNAJeK xVwOtoez07w6sWdhytcLAlVYXU+W/jhWcGMd0Kw7g4vHsp+NmXtHYxm8CCTCqqbxkT9F hMK/E3NbAHDDhKgNR6DKQ6K540B/GCi5E6iX7n8svrjdPZT/ijiGsw2oG7c3BTAD0Gva 9DEy82/jaK56LGAx19a/gTMgEdTDIAPwmwfOkQF8e6maHuH4qzpLxUwMBQfzdo40gj6/ 8BAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1qMAVSnywWT1jNzaP9Dz12jcC6XfF9pDAxMfxNaT2nA=; b=SUXSbS+dfVivR4AL3wSVWSo70vJwot78yIhcv73orMBCsnRGbhIjpSQp7DvubBymVO lFHnjpog21OXEH4Lp5APB22eKNfSZsdG+hCO04ZtdFV9vZsdYfvR6iVFyJuYUwY48u0H F7LJJSvaWEqSGn3khGgJXNj96ypnfW0DAJnmq2ycDVpIh1vkCLFvj593bJ4UVVKSd73z 6+h0TZdQ2tcVglzLb/5mfjh7GsuriwSo6+y+wgOxxZvfTQmP2xAciFQxjM24lOGvx3ha a6xshhPVkWi903mS7foLYavpWoVxjVvlrq1k3E1G1/yvPTHiy3S8IN5MCWr283OD1jJY Phwg== X-Gm-Message-State: AGRZ1gLHYZoe0F9rfrRIsuFBJCHZGnj0+/9BKBLjVwaWOiyrK1iesQZt 5zqKHdnCFgHXQCILXx7gWJE= X-Google-Smtp-Source: AJdET5f5l3Ko7ytbCVM/WoG9Kg+wjAaM+wTpESLwsaPsa32UEj/0tMhbd8R0nYZTufuwdi4E1zRM1g== X-Received: by 2002:a63:920a:: with SMTP id o10mr6911746pgd.141.1541458685571; Mon, 05 Nov 2018 14:58:05 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.58.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:58:04 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 5/6] of/fdt: Remove custom __early_init_dt_declare_initrd() implementation Date: Mon, 5 Nov 2018 14:54:30 -0800 Message-Id: <20181105225431.24485-6-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145807_618730_1D8526B4 X-CRM114-Status: GOOD ( 15.50 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Now that ARM64 uses phys_initrd_start/phys_initrd_size, we can get rid of its custom __early_init_dt_declare_initrd() which causes a fair amount of objects rebuild when changing CONFIG_BLK_DEV_INITRD. In order to make sure ARM64 does not produce a BUG() when VM debugging is turned on though, we must avoid early calls to __va() which is what __early_init_dt_declare_initrd() does and wrap this around to avoid running that code on ARM64. Signed-off-by: Florian Fainelli --- arch/arm64/include/asm/memory.h | 8 -------- drivers/of/fdt.c | 15 ++++++++++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index b96442960aea..dc3ca21ba240 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h @@ -168,14 +168,6 @@ #define IOREMAP_MAX_ORDER (PMD_SHIFT) #endif -#ifdef CONFIG_BLK_DEV_INITRD -#define __early_init_dt_declare_initrd(__start, __end) \ - do { \ - initrd_start = (__start); \ - initrd_end = (__end); \ - } while (0) -#endif - #ifndef __ASSEMBLY__ #include diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 88760a0983a7..cd72a41fcab2 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -891,15 +891,20 @@ const void * __init of_flat_dt_match_machine(const void *default_match, } #ifdef CONFIG_BLK_DEV_INITRD -#ifndef __early_init_dt_declare_initrd static void __early_init_dt_declare_initrd(unsigned long start, unsigned long end) { - initrd_start = (unsigned long)__va(start); - initrd_end = (unsigned long)__va(end); - initrd_below_start_ok = 1; + /* ARM64 would cause a BUG to occur here when CONFIG_DEBUG_VM is + * enabled since __va() is called too early. ARM64 does make use + * of phys_initrd_start/phys_initrd_size so we can skip this + * conversion. + */ + if (!IS_ENABLED(CONFIG_ARM64)) { + initrd_start = (unsigned long)__va(start); + initrd_end = (unsigned long)__va(end); + initrd_below_start_ok = 1; + } } -#endif /** * early_init_dt_check_for_initrd - Decode initrd location from flat tree From patchwork Mon Nov 5 22:54:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 993436 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="q/wnd0jO"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iO8QIlU2"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42pp7T0sRyz9sDT for ; Tue, 6 Nov 2018 10:00:53 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=jPK16/Xs2EOgBYCRCWgULnUGIJ5ab/JBjZSB0YCVYjg=; b=q/wnd0jOnclIsZnKzZNST0AOZD yN6LEa5nGaFkPUIipuf60SsEZ7RB/G4U4MB4CpRyBLDYqe4EYLRACGCSeJnOGys3buiF2mGj/giTt oGS0wBN7euznNDXnsG9uiirCMr/jL8LhQkIhE1pBSF/gs/441k0U4C9TWbxdpFqyJHUOgUp4SFSwh 77C1TJO87JnG46sqtp1q7OFbxajqnJWNP9BEEbL0KC2QTDKcFqQ0Iz9nO66K0uiijRmAac1kCfGDJ 68uJlN6R7p02dFLyowDqg++iUtJ+cxTkVH/hnJdG3S2GwAQdx+Xap7cXUtA8ahlc+Ca5sEeCYXZV3 EMIuH65w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnrV-0003QU-Q7; Mon, 05 Nov 2018 23:00:49 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJnp4-0008HU-EQ; Mon, 05 Nov 2018 22:58:20 +0000 Received: by mail-pf1-x444.google.com with SMTP id y18-v6so2747841pfn.1; Mon, 05 Nov 2018 14:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=N5C/Dk/32TAReMlAu4r3WfZ0cG0xx4/p3LhGJUIezOA=; b=iO8QIlU2AdfzSk8vfmSS1vkrdmjdB0U0lTL6ss1pW6/TAQyzC+9m+8rfZaB+a/plyX n7hn1W8V4B/kapQSwG9f81qmfpPXCnl6MAAOkpFfroDwTWyeEMokDxf6DP81hlQ6SxCS 1ki3NCO4zjBYn3cXyq0MeAocZMY0QiLhgP/qcgF9sHKyIP4GZVk37p/Y2id5XihGKFWg /h6tYeMoaydILMv+F+Ep2Yec6wak642cNb1yvNPLE2WtpBLcZZaSPT7SKQcatkBr7zxC U+9BMBkUj3F4JWFGwHRGyZgQ4sP0kkUDEJe/qO08vhp/JvnQjS2FvfDNu8GeUmLsQG+R O+3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=N5C/Dk/32TAReMlAu4r3WfZ0cG0xx4/p3LhGJUIezOA=; b=jF4pK1D+L8OUrnX/tvMHJtV0v0BQmxd4tP/7YxLuj7stlPYQgByhXe+Fiagt+PieaA 5h4AhZZytSZl7+Fe4cw2IZ5ooKUpArZcxIC3+7cHx4TTaZrDoyuQCaPTCNPhPyjX+kn4 +FSWANHmiGTBXDudnsDWgcljb6zjvUB6dNipJnJzcOTb2nZGSrLK7oS08FwSC6K6pI05 HX+9r55leh2XLQ0COYJTVEiGsFX8MTpyF5KA67TgryNz+qONNMqfscvX5OeVIUpMTq/A 66c7qFJbHMucWaAexY97HY5mU+5EuR+aybxnjbB0tQdO0QaGUFnbxnKV8GLvVuR+/D+K Jslw== X-Gm-Message-State: AGRZ1gKfwf6PlNuHktFLj52dr48daTstvZzOmn6ddxR/zE0vHF9HlKsW p+dyQDkNoTi+NDKQIli2EMs= X-Google-Smtp-Source: AJdET5eYY+m1nQl01vIFU8Xe0gXFoLHQjVrEKByv775fh1TR9lRHUuzS0+/uWutUxzE+WkkempUBUg== X-Received: by 2002:a63:e749:: with SMTP id j9-v6mr21340677pgk.246.1541458687607; Mon, 05 Nov 2018 14:58:07 -0800 (PST) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id q195sm12898479pgq.7.2018.11.05.14.58.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 14:58:06 -0800 (PST) From: Florian Fainelli To: linux-kernel@vger.kernel.org Subject: [PATCH v4 6/6] arch: Move initrd= parsing into do_mounts_initrd.c Date: Mon, 5 Nov 2018 14:54:31 -0800 Message-Id: <20181105225431.24485-7-f.fainelli@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181105225431.24485-1-f.fainelli@gmail.com> References: <20181105225431.24485-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_145818_566121_9330E7BA X-CRM114-Status: GOOD ( 15.13 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:444 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: CHANDAN VN , Catalin Marinas , Will Deacon , Stefan Agner , Masahiro Yamada , deanbo422@gmail.com, Frank Rowand , Florian Fainelli , linux@armlinux.org.uk, rppt@linux.ibm.com, Andrey Ryabinin , Laura Abbott , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE" , Marc Zyngier , Andrey Konovalov , Kristina Martsenko , Russell King , Rob Herring , green.hu@gmail.com, gxt@pku.edu.cn, "moderated list:ARM64 PORT AARCH64 ARCHITECTURE" , linux-snps-arc@lists.infradead.org, ard.biesheuvel@linaro.org, vgupta@synopsys.com, Johannes Weiner , Andrew Morton , Robin Murphy , Greg Hackmann MIME-Version: 1.0 Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ARC, ARM, ARM64 and Unicore32 are all capable of parsing the "initrd=" command line parameter to allow specifying the physical address and size of an initrd. Move that parsing into init/do_mounts_initrd.c such that we no longer duplicate that logic. Signed-off-by: Florian Fainelli --- arch/arc/mm/init.c | 25 +++++-------------------- arch/arm/mm/init.c | 17 ----------------- arch/arm64/mm/init.c | 18 ------------------ arch/unicore32/mm/init.c | 18 ------------------ init/do_mounts_initrd.c | 17 +++++++++++++++++ 5 files changed, 22 insertions(+), 73 deletions(-) diff --git a/arch/arc/mm/init.c b/arch/arc/mm/init.c index f8fe5668b30f..43bf4c3a1290 100644 --- a/arch/arc/mm/init.c +++ b/arch/arc/mm/init.c @@ -78,24 +78,6 @@ void __init early_init_dt_add_memory_arch(u64 base, u64 size) base, TO_MB(size), !in_use ? "Not used":""); } -#ifdef CONFIG_BLK_DEV_INITRD -static int __init early_initrd(char *p) -{ - unsigned long start, size; - char *endp; - - start = memparse(p, &endp); - if (*endp == ',') { - size = memparse(endp + 1, NULL); - - initrd_start = (unsigned long)__va(start); - initrd_end = (unsigned long)__va(start + size); - } - return 0; -} -early_param("initrd", early_initrd); -#endif - /* * First memory setup routine called from setup_arch() * 1. setup swapper's mm @init_mm @@ -140,8 +122,11 @@ void __init setup_arch_memory(void) memblock_reserve(low_mem_start, __pa(_end) - low_mem_start); #ifdef CONFIG_BLK_DEV_INITRD - if (initrd_start) - memblock_reserve(__pa(initrd_start), initrd_end - initrd_start); + if (phys_initrd_size) { + memblock_reserve(phys_initrd_start, phys_initrd_size); + initrd_start = (unsigned long)__va(phys_initrd_start); + initrd_end = initrd_start + phys_initrd_size; + } #endif early_init_fdt_reserve_self(); diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index a3b6f1f1cbaf..478ea8b7db87 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -51,23 +51,6 @@ unsigned long __init __clear_cr(unsigned long mask) #endif #ifdef CONFIG_BLK_DEV_INITRD -static int __init early_initrd(char *p) -{ - phys_addr_t start; - unsigned long size; - char *endp; - - start = memparse(p, &endp); - if (*endp == ',') { - size = memparse(endp + 1, NULL); - - phys_initrd_start = start; - phys_initrd_size = size; - } - return 0; -} -early_param("initrd", early_initrd); - static int __init parse_tag_initrd(const struct tag *tag) { pr_warn("ATAG_INITRD is deprecated; " diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c index a66ffcde5f13..7474093363bc 100644 --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -61,24 +61,6 @@ s64 memstart_addr __ro_after_init = -1; phys_addr_t arm64_dma_phys_limit __ro_after_init; -#ifdef CONFIG_BLK_DEV_INITRD -static int __init early_initrd(char *p) -{ - unsigned long start, size; - char *endp; - - start = memparse(p, &endp); - if (*endp == ',') { - size = memparse(endp + 1, NULL); - - phys_initrd_start = start; - phys_initrd_size = size; - } - return 0; -} -early_param("initrd", early_initrd); -#endif - #ifdef CONFIG_KEXEC_CORE /* * reserve_crashkernel() - reserves memory for crash kernel diff --git a/arch/unicore32/mm/init.c b/arch/unicore32/mm/init.c index 02aa2c0b295e..85ef2c624090 100644 --- a/arch/unicore32/mm/init.c +++ b/arch/unicore32/mm/init.c @@ -30,24 +30,6 @@ #include "mm.h" -#ifdef CONFIG_BLK_DEV_INITRD -static int __init early_initrd(char *p) -{ - unsigned long start, size; - char *endp; - - start = memparse(p, &endp); - if (*endp == ',') { - size = memparse(endp + 1, NULL); - - phys_initrd_start = start; - phys_initrd_size = size; - } - return 0; -} -early_param("initrd", early_initrd); -#endif - /* * This keeps memory configuration data used by a couple memory * initialization functions, as well as show_mem() for the skipping diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index 45865b72f4ea..732d21f4a637 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c @@ -27,6 +27,23 @@ static int __init no_initrd(char *str) __setup("noinitrd", no_initrd); +static int __init early_initrd(char *p) +{ + phys_addr_t start; + unsigned long size; + char *endp; + + start = memparse(p, &endp); + if (*endp == ',') { + size = memparse(endp + 1, NULL); + + phys_initrd_start = start; + phys_initrd_size = size; + } + return 0; +} +early_param("initrd", early_initrd); + static int init_linuxrc(struct subprocess_info *info, struct cred *new) { ksys_unshare(CLONE_FS | CLONE_FILES);