public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@foss.st.com>
To: <u-boot@lists.denx.de>
Subject: Re: [PATCH] lmb: Default to not-LMB_USE_MAX_REGIONS
Date: Thu, 23 Feb 2023 11:01:12 +0100	[thread overview]
Message-ID: <ad0e5ef7-1cb6-796e-7394-e8caae3ded8c@foss.st.com> (raw)
In-Reply-To: <Y+O86N/0YHfddoI9@bill-the-cat>


On 2/8/23 16:16, Tom Rini wrote:
> 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:
>>>
>>>> Hi Tom,
>>>>
>>>> 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.
>>>>
>>>> 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=64` isn't it? Or do I miss something?
>>>>
>>>> For the other question this raises to me is it in general safe to
>>>> just
>>>> increase this limit, let's say to 16?
>>>>
>>>> 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?
>>> 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.
>>
>> But since you no longer enable LMB_USE_MAX_REGIONS then theres the two
>> limits (default=8)
>>
>> LMB_MEMORY_REGIONS=8
>> LMB_RESERVED_REGIONS=8
>>
>> 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=64`.
>>
>> At least for me rgn->max is still set to 8 and also after this commit I
>> hit that limit. [1]
>>
>> [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.

Hi,

only for reference, with new LMB management

  config LMB_USE_MAX_REGIONS
  	bool "Use a common number of memory and reserved regions in lmb lib"
  	depends on LMB
-	default y

The correct patch without regression is for each board

-CONFIG_LMB_MAX_REGIONS=64
+CONFIG_LMB_RESERVED_REGIONS=64


See 
https://lore.kernel.org/all/20210310091632.17103-1-patrick.delaunay@foss.st.com/


Patrick



      reply	other threads:[~2023-02-23 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 23:08 [PATCH] lmb: Default to not-LMB_USE_MAX_REGIONS Tom Rini
2023-02-07 16:49 ` Tom Rini
2023-02-08 14:33 ` Philippe Schenker
2023-02-08 14:54   ` Tom Rini
2023-02-08 15:13     ` Philippe Schenker
2023-02-08 15:16       ` Tom Rini
2023-02-23 10:01         ` Patrick DELAUNAY [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ad0e5ef7-1cb6-796e-7394-e8caae3ded8c@foss.st.com \
    --to=patrick.delaunay@foss.st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox