From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB130C433EF for ; Sun, 21 Nov 2021 06:44:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XpfEz0EQrhE63CwfmmlEkbGR+uEl50NgCYyd/5u14v4=; b=xAD5diWCfq02vA +mu6R/9yED3Qb2GmucYEQdWJRZ2pRcrAuFyFyLuWcTcFjKrqHMqbOO9ASSO9lTzx8ldDba8UTVF7m dTKZOe1eejJ1ZTTW3KXo78k1+khdn6qBbKjaV6t7t2T8i5NMcMg/HYtGfsVGl4jPkYccMcH2AgQ7y 5JBVhD082kHsYyL6YrWStTV3qmqGQu2wlp1mZFrWJKfbkJSZnkz9pDEavekYvZY8VsRpqR9HOB86S X8YRqw57VjQ8ox9J5hPJ1hjLV7MGAPGkPC4cJabgMvFLwiTjMEbgzkdEbyzGWbWvvfjeS5smoiabT GkmX7oI0iUHS5rGoOYEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mogaJ-00DIye-U6; Sun, 21 Nov 2021 06:44:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mogaG-00DIxq-VM; Sun, 21 Nov 2021 06:44:18 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 60B98604AC; Sun, 21 Nov 2021 06:43:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637477055; bh=fF0qMHEWbaZWbEit/VvNjQKirKtWS4o0c8b9dFvtOFg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=o40YeyKWlss6qPqzIaBC1BRaoNsy8h4lRluMS6PA711BRFcqyhJOnzbksEMtKtJO/ 8jbTZZa3TfDTwFyR4bB+BvkwZH8B4Lq6zUtBDhL0B4WDBH9OrnY/ZIAuUCLySCed3G BY0pW/832nzdNqDcLtde/+ux9ozmIiM3YLALWMwekxe0nZCbZ8Eac9fyNJkYF8xblI zzUk/gDwJpgD0wAYRzlFYo+zhx5+msTuR9KF/8/1WOgKdEL1RlhcobAeHzb+LuS7g/ jBCVo5DEsOze9uLZm95vmKlvgKfjbEPyxEhw1wZAFN+rxMTmDM0V/oXbaGrjJoZ0t1 JqBkAezCYdBnA== Date: Sun, 21 Nov 2021 08:43:47 +0200 From: Mike Rapoport To: Calvin Zhang Cc: Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Yoshinori Sato , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rich Felker , Chris Zankel , Max Filippov , Rob Herring , Frank Rowand , Andrew Morton , David Hildenbrand , Arnd Bergmann , Kefeng Wang , Vladimir Isaev , "Russell King (Oracle)" , "Kirill A. Shutemov" , Guenter Roeck , Marc Zyngier , David Brazdil , Anshuman Khandual , Andrey Konovalov , Mark Rutland , Souptick Joarder , Jinyang He , "Rafael J. Wysocki" , Serge Semin , Tiezhu Yang , Geert Uytterhoeven , Randy Dunlap , Ley Foon Tan , Andreas Oetken , Christophe JAILLET , Christophe Leroy , Zhang Yunkai , Andy Shevchenko , Markus Elfring , Ganesh Goudar , "Aneesh Kumar K.V" , Atish Patra , Anup Patel , Nick Kossifidis , Alexandre Ghiti , Vitaly Wool , Thierry Reding , Lee Jones , Guo Ren , Alexander Sverdlin , Greg Kroah-Hartman , Mauri Sandberg , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211120_224417_052867_D30B80FF X-CRM114-Status: GOOD ( 16.72 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > The count of reserved regions in /reserved-memory was limited because > the struct reserved_mem array was defined statically. This series sorts > out reserved memory code and allocates that array from early allocator. > > Note: reserved region with fixed location must be reserved before any > memory allocation. While struct reserved_mem array should be allocated > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > do reservation only and add another call to initialize reserved memory. > So arch code have to change for it. I think much simpler would be to use the same constant for sizing memblock.reserved and reserved_mem arrays. If there is too much reserved regions in the device tree, reserving them in memblock will fail anyway because memblock also starts with static array for memblock.reserved, so doing one pass with memblock_reserve() and another to set up reserved_mem wouldn't help anyway. > I'm only familiar with arm and arm64 architectures. Approvals from arch > maintainers are required. Thank you all. > > Calvin Zhang (2): > of: Sort reserved_mem related code > of: reserved_mem: Remove reserved regions count restriction > > arch/arc/mm/init.c | 3 + > arch/arm/kernel/setup.c | 2 + > arch/arm64/kernel/setup.c | 3 + > arch/csky/kernel/setup.c | 3 + > arch/h8300/kernel/setup.c | 2 + > arch/mips/kernel/setup.c | 3 + > arch/nds32/kernel/setup.c | 3 + > arch/nios2/kernel/setup.c | 2 + > arch/openrisc/kernel/setup.c | 3 + > arch/powerpc/kernel/setup-common.c | 3 + > arch/riscv/kernel/setup.c | 2 + > arch/sh/kernel/setup.c | 3 + > arch/xtensa/kernel/setup.c | 2 + > drivers/of/fdt.c | 107 +--------------- > drivers/of/of_private.h | 12 +- > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > include/linux/of_reserved_mem.h | 4 + > 17 files changed, 207 insertions(+), 139 deletions(-) > > -- > 2.30.2 > -- Sincerely yours, Mike. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv