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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 C465AC433F5 for ; Mon, 22 Nov 2021 20:58:18 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HyfkK1TM1z2yK6 for ; Tue, 23 Nov 2021 07:58:17 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=o40YeyKW; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=o40YeyKW; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HxgqV48hrz2xtC for ; Sun, 21 Nov 2021 17:44:22 +1100 (AEDT) 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 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> X-Mailman-Approved-At: Tue, 23 Nov 2021 07:57:41 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Kirill A. Shutemov" , Mark Rutland , Kefeng Wang , Rich Felker , Jinyang He , David Hildenbrand , Lee Jones , linux-kernel@vger.kernel.org, Max Filippov , Anup Patel , Guo Ren , Guo Ren , linux-csky@vger.kernel.org, Nick Kossifidis , Vladimir Isaev , Tiezhu Yang , Vincent Chen , Will Deacon , Markus Elfring , Vitaly Wool , Jonas Bonn , devicetree@vger.kernel.org, linux-snps-arc@lists.infradead.org, uclinux-h8-devel@lists.sourceforge.jp, Yoshinori Sato , Palmer Dabbelt , linux-sh@vger.kernel.org, "Rafael J. Wysocki" , Russell King , Ley Foon Tan , Geert Uytterhoeven , "Aneesh Kumar K.V" , Catalin Marinas , Ganesh Goudar , David Brazdil , linux-riscv@lists.infradead.org, Guenter Roeck , Alexander Sverdlin , Thierry Reding , Albert Ou , Arnd Bergmann , Anshuman Khandual , linux-xtensa@linux-xtensa.org, Vineet Gupta , Andreas Oetken , Stefan Kristiansson , "Russell King \(Oracle\)" , Rob Herring , Christophe JAILLET , Greentime Hu , Paul Walmsley , Stafford Horne , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Andrey Konovalov , Christophe Leroy , Chris Zankel , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Alexandre Ghiti , Nick Hu , Atish Patra , Greg Kroah-Hartman , Randy Dunlap , Frank Rowand , Serge Semin , Dinh Nguyen , Zhang Yunkai , Palmer Dabbelt , Souptick Joarder , Marc Zyngier , Mauri Sandberg , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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.