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 E06FEC636CC for ; Wed, 8 Feb 2023 15:17:07 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A603885E01; Wed, 8 Feb 2023 16:17:05 +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="hJRZYYqJ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 717A985AEB; Wed, 8 Feb 2023 16:17:03 +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 EEF6985E01 for ; Wed, 8 Feb 2023 16:16:59 +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 z5so21015174qtn.8 for ; Wed, 08 Feb 2023 07:16:59 -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=jUxJ8g8Pwb+juYAQP/jAKfKvn2Oy+SD1s+lNgTr9Qgo=; b=hJRZYYqJNEYQWg8Fl0AryzkoFBNSiOVG+p7chPqG0Slt5EnAwPMCbNvNpl8TUDRL78 uP8wqJh1mdtTYaeHsf/D3upKEv3am2Z1ZGC9s4Xnypwk9zX9o7xVusMFb64q1saxir8E oQUpspaCVUacQnwHdzT3co68CjufV/u/EQ2aw= 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=jUxJ8g8Pwb+juYAQP/jAKfKvn2Oy+SD1s+lNgTr9Qgo=; b=Y5catWsgA6KcxRKEGlWvn+uUKuxt8+JW9RfnWb5RJ9aTCjVqb42S5aZjEoc0cyt82x R8s6WqJQUEzWjRnRIHh7xXKNV9dNCf1+kA416/oK/oTMyGA2CeGj5pQpJj8q3W04T49s 6Cv7ps91PqZkJtOICnycNlUfwUIGVWXjAA6cWB9nOA8xC0ReQk0yvN1xXnBr3ET6gMSx WAV5uTy9O1Qq0xVssTIrPOitwY/d4eW6kSPadQ0Me+8idJllqLKAeoQJhLviH+hFPs6Q rF5hFbb9n5brcvFfoiSXvhXP50etg3euuuu4+irjs2EaSVUJXaELgQldw6o73npPQlnv VM6w== X-Gm-Message-State: AO0yUKU+t3yId8DbesK6b+wpomupFqjPaY3C/qHZBfSdkI4VecTd9M8j ZO0WPXh5YD4i3UUUN3V0BCFix1n9nTG8paCMIgk= X-Google-Smtp-Source: AK7set9Ex1Ym1+YoQYHeMoPxLCl/sr+TksPylVaH3Ayy2UlXMeOZxE462SCmyRhVSTLi3grAzeTqwg== X-Received: by 2002:a05:622a:48f:b0:3b9:b703:d803 with SMTP id p15-20020a05622a048f00b003b9b703d803mr13132015qtx.3.1675869418702; Wed, 08 Feb 2023 07:16:58 -0800 (PST) Received: from bill-the-cat (2603-6081-7b00-6400-90cc-7e59-435b-3104.res6.spectrum.com. [2603:6081:7b00:6400:90cc:7e59:435b:3104]) by smtp.gmail.com with ESMTPSA id d24-20020ac851d8000000b003b82a07c4d6sm11542278qtn.84.2023.02.08.07.16.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:16:58 -0800 (PST) Date: Wed, 8 Feb 2023 10:16:56 -0500 From: Tom Rini To: Philippe Schenker Cc: "u-boot@lists.denx.de" Subject: Re: [PATCH] lmb: Default to not-LMB_USE_MAX_REGIONS Message-ID: References: <20230125230823.1567778-1-trini@konsulko.com> <32b441a41602eda85b65682d60354141fbc9c5d8.camel@toradex.com> <7077d0d45bb5e7d0e805cd2c360135b687ef56b0.camel@toradex.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qiBWVg3EBmXVjY/y" Content-Disposition: inline In-Reply-To: <7077d0d45bb5e7d0e805cd2c360135b687ef56b0.camel@toradex.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 --qiBWVg3EBmXVjY/y Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2023 at 03:13:31PM +0000, Philippe Schenker wrote: > On Wed, 2023-02-08 at 09:54 -0500, Tom Rini wrote: > > On Wed, Feb 08, 2023 at 02:33:58PM +0000, Philippe Schenker wrote: > >=20 > > > Hi Tom, > > >=20 > > > We currently face an issue on our apalis-imx8 machine, that is not > > > able > > > to boot with a ramdisk. What happens is that there are all 8 of 8 > > > LMBs > > > reserved and fdt tries to allocate one more, probably for > > > relocation. > > >=20 > > > I now stumbled on this recent patch and noticed that in my > > > understanding > > > this is introducing a regression to all the boards you remove > > > `CONFIG_LMB_MAX_REGIONS=3D64` isn't it? Or do I miss something? > > >=20 > > > For the other question this raises to me is it in general safe to > > > just > > > increase this limit, let's say to 16? > > >=20 > > > And since it was quite an effort debugging this issue I thought of > > > adding a debug print if the MAX cnt in lmb.c is being hit to ease > > > that > > > pain for other devs, would you be fine with something like this? > >=20 > > Right, so with the late in the cycle change to make EFI use LMBs as > > well, a lot of platforms hit the 8 of 8 LMBs now in use problem. The > > change here switches from a static allocation of a maximum number of > > LMBs to dynamically allocating as many of them as needed. >=20 >=20 > But since you no longer enable LMB_USE_MAX_REGIONS then theres the two > limits (default=3D8) >=20 > LMB_MEMORY_REGIONS=3D8 > LMB_RESERVED_REGIONS=3D8 >=20 > that are limiting the maximum LMB numbers. So in my view this commit > does create a regression for all boards you delete > `CONFIG_LMB_MAX_REGIONS=3D64`. >=20 > At least for me rgn->max is still set to 8 and also after this commit I > hit that limit. [1] >=20 > [1] https://source.denx.de/u-boot/u-boot/-/blob/master/lib/lmb.c#L288 Ugh, you're right and I missed what this ended up doing, thanks for explaining it. I'll go revert my commit shortly and pick up one of the ones that raised the default. --=20 Tom --qiBWVg3EBmXVjY/y Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmPjvOIACgkQFHw5/5Y0 tyxz/gwAm3T/vgss4jF4LOW7UHbGcYSagoAvyUvxaXrRGyD4v28lGnWqfBvp24qA ajykkS1eiNjEv39xiK0tIRDHwtDUF7rEpcHzFyBz15eEkDK/12GEo2Rg4r3pBeXQ 4whTP/jYJJ+03f3choklEwrcGFWeVThkHbqFoEqsM03d9SzOA40qWJJRzFmHk7Xq Kf39DQ0V1ze37Z5zUiXN8HPSuMU65aYQeTGPBUqmGR9r9DpnmBCSpwxH+YAxwOHN jiDTHuDBqi3530cJ2qALIX00KaelEdGku/SePJUAnPP1SDV8r00bZVb/DDCArfae AJ4JqfyU2jEMPsqn7ImJRb6RK/4yg6zqHgbbEkIXMi2ZfV7Q4rPu7JZgKlW4QFFA 5LN+GaU7o5GzpgFGACGCtGJ9MOYO4kzoTp3ZTM55cpAuUTcoxGyP1wx7QzxN6986 I99vGkbfJ5b5lkX8rPgYdsUBF4SAuYNdhtm0cUG2dhkODrZ2lWgDGrJnOcTdyYlX CLeKwsE2 =/Y/n -----END PGP SIGNATURE----- --qiBWVg3EBmXVjY/y--