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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 36981C61DA4 for ; Thu, 23 Feb 2023 22:34:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DB4E85634; Thu, 23 Feb 2023 23:34:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="ShKozDgY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1A0E982A55; Thu, 23 Feb 2023 23:34:33 +0100 (CET) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2933185648 for ; Thu, 23 Feb 2023 23:34:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82c.google.com with SMTP id b6so6571524qtb.1 for ; Thu, 23 Feb 2023 14:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=o6Dpl4XxixONsR1swr3aL8cE/FEhCQCEQKlZf6xrBks=; b=ShKozDgY8aGw468u8foaVqM+PQsxcbqtK1tG8Hb07QJTw2rNxn6lN/8OE9CU+FLnWh Q27YvuBgLTFeqYYkhMg7TEyOh962Sd7MkhubfHWN2ysjyr6VQbBcfRMX7Bsc+p+gT7lM gXuxwyQWuuKcN02PXFzGTZbzGu6qBs6Pgizxg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=o6Dpl4XxixONsR1swr3aL8cE/FEhCQCEQKlZf6xrBks=; b=ekNY7E0nbGmbbqZoims5kCwKtEt9QEoDrttQ0j4nxSB6FKfvxbNG/7I1x8Crlj806p CbXNRXmovoZes1ZUgm0XsomFam5ZxQR7ZSiYEsH0fYFWNFmP5qbXt/Fd3QE1q8UVOfXT udWyh/pLsheLntZ31w7MJdh0Ft3z6zCXShz1LJJb/eZ+r2Mz20Ys0ucVYcqLry215NQN laCBzs38rHPPoBKD5/3D5K/iyjOo2ntBSpzzCkN5qtFsCU547EiBx6UHYqqP+8qNkG7+ Ww6kSWtj3mPTAVoW7J16v23l/2Ug3Y8WiqPTf/hkIrhnGyJAoJkt7Zx14rXPTZrZEGtR 7l7w== X-Gm-Message-State: AO0yUKXRBaMkmdRrKPahUF7f3wgIS6QhTxXKQkga4rsD1Iswpy1TnHIO o6n5ez85qmLY6kbjxT4FBDaJAg== X-Google-Smtp-Source: AK7set/bFMcu52BN2ut8ZgAufTRfevbn5DdbGo0GF1Rv3igmeeuTG0B7N07oRmUwemd3E0na3YwK4A== X-Received: by 2002:a05:622a:307:b0:3b9:b7c9:f0d1 with SMTP id q7-20020a05622a030700b003b9b7c9f0d1mr9340225qtw.39.1677191667780; Thu, 23 Feb 2023 14:34:27 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-7b76-35a4-b335-d04d.res6.spectrum.com. [2603:6081:7b00:6400:7b76:35a4:b335:d04d]) by smtp.gmail.com with ESMTPSA id c197-20020ae9edce000000b00738e8e81dc9sm6485022qkg.75.2023.02.23.14.34.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 14:34:27 -0800 (PST) Date: Thu, 23 Feb 2023 17:34:25 -0500 From: Tom Rini To: Patrick DELAUNAY Cc: Michal =?iso-8859-1?Q?Such=E1nek?= , Francesco Dolcini , u-boot@lists.denx.de, Guillaume Gardet , Simon Glass , Philippe Reynes , Ilias Apalodimas , Leo Yu-Chi Liang , Sughosh Ganu , Kautuk Consul , Brandon Maier , Rasmus Villemoes , Heinrich Schuchardt , Sjoerd Simons Subject: Re: [PATCH] lmb: Bump CONFIG_LMB_MAX_REGIONS Message-ID: References: <20230127130012.31499-1-msuchanek@suse.de> <20230208191134.GV19419@kitsune.suse.cz> <20230217092838.GG19419@kitsune.suse.cz> <9b7d985a-3c3d-7bdd-200a-1b2e5464e2a7@foss.st.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pd0wZNuixA7p8FfT" Content-Disposition: inline In-Reply-To: <9b7d985a-3c3d-7bdd-200a-1b2e5464e2a7@foss.st.com> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean --pd0wZNuixA7p8FfT Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 23, 2023 at 10:24:44AM +0100, Patrick DELAUNAY wrote: > Hi, >=20 > On 2/17/23 10:28, Michal Such=E1nek wrote: > > Hello, > >=20 > > On Sun, Feb 12, 2023 at 06:45:36PM -0500, Tom Rini wrote: > > > On Wed, Feb 08, 2023 at 02:50:16PM -0500, Tom Rini wrote: > > > > On Wed, Feb 08, 2023 at 08:11:34PM +0100, Michal Such=E1nek wrote: > > > > > Hello, > > > > >=20 > > > > > On Wed, Feb 08, 2023 at 01:25:50PM -0500, Tom Rini wrote: > > > > > > On Wed, Feb 08, 2023 at 07:24:25PM +0100, Francesco Dolcini wro= te: > > > > > > > Hello, > > > > > > >=20 > > > > > > > On Fri, Jan 27, 2023 at 08:54:55AM -0500, Tom Rini wrote: > > > > > > > > On Fri, Jan 27, 2023 at 02:00:12PM +0100, Michal Suchanek w= rote: > > > > > > > > > It is reported that in some configurations it is not poss= ible to boot > > > > > > > > > because u-boot runs out of lmbs. > > > > > > > > >=20 > > > > > > > > > commit 06d514d77c ("lmb: consider EFI memory map") increa= ses lmb usage, > > > > > > > > > hence is likely the cause of the lmb overflow. > > > > > > > > >=20 > > > > > > > > > Fixes: 06d514d77c ("lmb: consider EFI memory map") > > > > > > > > > Link: https://bugzilla.opensuse.org/show_bug.cgi?id=3D120= 7562 > > > > > > > > > Signed-off-by: Michal Suchanek > > > > > > > Reviewed-by: Francesco Dolcini > > > > > > >=20 > > > > > > > > I plan to pick up > > > > > > > > https://patchwork.ozlabs.org/project/uboot/patch/2023012523= 0823.1567778-1-trini@konsulko.com/ > > > > > > > > as the alternative fix for this issue and would suggest tha= t any distro > > > > > > > > hitting the problem on v2023.01 apply the above instead of = increasing > > > > > > > > the limit. > > > > > > > Tom, my understanding is that you plan to merge this or an eq= uivalent > > > > > > > change, correct? Otherwise I would need to send some more pat= ches to > > > > > > > update a few board defconfig that are affected by this specif= ic issue. > > > > > > Yes, I was hoping to push the equivalent of this patch a few ho= urs ago, > > > > > > along with the revert. Then I noticed the test in test/lib/lmb.= c doesn't > > > > > > scale past 8, and I just now figured out what that should look = like > > > > > > instead, I believe. > > > > > reportedly neither fixes the problem in all cases, and raising > > > > > CONFIG_LMB_RESERVED_REGIONS is required. > > > > >=20 > > > > > Looks like the mechanism to add regions above the default number = does > > > > > not work as intended. > > > > >=20 > > > > > The test is to boot rPi 4 from USB directly with recent firmware. > > > > Well, given 0089affee275 ("configs: stm32mp15: increase the number = of > > > > reserved memory region in lmb") I guess this has been run in to bef= ore, > > > > but not resolved more generically. > > > I wonder if > > > https://patchwork.ozlabs.org/project/uboot/patch/20230212150706.29670= 07-2-sjoerd@collabora.com/ > > > is what will finish dealing with these issues, even the ones that had > > > perhaps shown up before and been addressed in the commit I mentioned > > > above? > > Looks like this together with raising the maximum number of regions > > works, that is v2023.04-rc2 should be fixed. > >=20 > > Thanks > >=20 > > Michal >=20 >=20 > For STM32MP15x platform with have the same issue when the number of reser= ved > regions increased in Linux device tree. >=20 >=20 > I try to increase the region by default with CONFIG_LMB_MAX_REGIONS, >=20 > but my patch increase the used RAM size for some platform (with compilati= on > issue). >=20 >=20 > For Tom ask me to propose a backward compatible configuration >=20 > https://lore.kernel.org/all/18550712-c32d-e08b-c38e-6c63bad09009@foss.st.= com/ >=20 > =3D> CONFIG_USE_LMB_MAX_REGIONS >=20 >=20 > Moreover, if you increased CONFIG_LMB_MAX_REGIONS >=20 > the same number of region (N) is used for reserved regions (N) and for=A0 > memory region (N) >=20 > =3D> the total size used =3D 2 * N * size of each memory region descripto= r. >=20 >=20 > But for most of case only the number reserved regions need to be increased > to parse the device tree. >=20 >=20 > With my patch the number of regions are statically managed by=A0 2 array > independently >=20 > - reserved regions =3D CONFIG_LMB_RESERVED_REGIONS >=20 > - memory region =3D CONFIG_LMB_MEMORY_REGIONS >=20 > And the total number of region (size of struct in memory) =3D >=20 > CONFIG_LMB_RESERVED_REGIONS + CONFIG_LMB_MEMORY_REGIONS >=20 >=20 > I think a good solution to have by default, if you want managed more > reserved memory by default in U-Boot for all platform: >=20 >=20 > =3D> LMB_USE_MAX_REGIONS=3Dn=A0 instead of 'y' today >=20 > =3D> LMB_MEMORY_REGIONS=3D8 >=20 > =3D> LMB_RESERVED_REGIONS=3D16 or 32 instead of 8 today by default >=20 >=20 > And change the defconfig for the size constraint platforms >=20 > to use the previous behavior with LMB_USE_MAX_REGIONS=3Dy. >=20 >=20 > NB: I define the default value with 8 to keep the previous limit and >=20 > =A0=A0=A0=A0=A0=A0 I just increase the number of region for the STM32MP p= latform: >=20 >=20 > configs/stm32mp15_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=3D16 > configs/stm32mp15_trusted_defconfig:170:CONFIG_LMB_RESERVED_REGIONS=3D16 > configs/stm32mp13_defconfig:81:CONFIG_LMB_RESERVED_REGIONS=3D16 > configs/stm32mp15_basic_defconfig:194:CONFIG_LMB_RESERVED_REGIONS=3D16 >=20 > I use the default value for CONFIG_LMB_MEMORY_REGIONS =3D8 >=20 >=20 > Reference =3D https://lore.kernel.org/all/20210310091632.17103-1-patrick.= delaunay@foss.st.com/ Ah, OK, thanks for explaining. --=20 Tom --pd0wZNuixA7p8FfT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmP36fEACgkQFHw5/5Y0 tyyoSwv8CItxErVDxhWnitDNkd6NTfrbD0ta3T8r8ycpesg+ahKTPSFDhgJTY6KM v6lRMh6laY3q24h8FcRb9EnERYIJL795T1kQCLFvQPSjR1KEaPCibOcW+BIxDKVg Lk/Za7DE5G5Q/37dogrYUfxMaNvaTSxLYvNCspm2BR9NQcrmYb1YSYzp0zK8+7FV EHHD725IBafg5R9+64gmi2sTrkkPzl5/2w0dsWpwjPozilbOxzJGjinXfDk8vtwN 26Quy0QaFTGqB/uiB/ThiZoYkKY5MeFpRI6aiJU+lupN0eQQX2PWZzdoZEy74YMh QmtFqiafYI1vw7qGNOuRdpoABDAxF1D4Cx5A54PYKXGe51sPS7utH/LwmZJEKo5W 2BLc4y0IsheXKtGR1NpJB8oY+7y/oVKE6PapYNe3hZCiQ2Q452ZNojd2YlWkUWhl 8tOK5xL+sKGozbv6+h3y8Inb0x5bIkzQFrBHaLSsu3LTTO5Dy+DLMACGWLJxJ/3K X4UqB820 =vCv8 -----END PGP SIGNATURE----- --pd0wZNuixA7p8FfT--