[PATCH 7/7] fs: Fix a confusing error about overlapping regions

Simon Glass sjg at chromium.org
Sun Sep 3 20:06:13 CEST 2023


Hi Tom,

On Sun, 3 Sept 2023 at 10:42, Tom Rini <trini at konsulko.com> wrote:
>
> On Thu, Aug 31, 2023 at 06:15:19PM -0600, Simon Glass wrote:
> > Hi Tom,
> >
> > On Wed, 23 Aug 2023 at 09:14, Tom Rini <trini at konsulko.com> wrote:
> > >
> > > On Wed, Aug 23, 2023 at 07:42:03AM -0600, Simon Glass wrote:
> > >
> > > > When lmb runs out of space in its internal tables, it gives errors on
> > > > every fs load operation. This is horribly confusing, as the poor user
> > > > tries different memory regions one at a time.
> > > >
> > > > Use the updated API to check the error code and print a helpful message.
> > > > Also, allow the operation to proceed.
> > > >
> > > > Update the tests accordingly.
> > > >
> > > > Signed-off-by: Simon Glass <sjg at chromium.org>
> > > [snip]
> > > > +     if (ret == -E2BIG) {
> > > > +             log_warning("Reservation tables exhausted: see CONFIG_LMB_USE_MAX_REGIONS\n");
> > > > +             return 0;
> > > > +     }
> > >
> > > This isn't the right option.  Everyone has CONFIG_LMB_USE_MAX_REGIONS
> > > set.  You would want to increase CONFIG_LMB_MAX_REGIONS.
> > >
> > > But it sounds like what you've found and fixed is an underlying problem
> > > as to why 16 regions isn't enough in some common cases now?  So we could
> >
> > I don't think I have fixed anything. But I'll send v2 and perhaps it
> > will be clearer what is going on here.
> >
> > > possibly avoid the string size growth here and have a comment that also
> > > matches up with the help under LMB_MAX_REGIONS?
> >
> > I don't know, sorry. The size of struct(lmb) on 64-bit sandbox is
> > about 400 bytes. There seems to be a lot of code to save not much
> > memory.
>
> What do you mean here?  The alternative is not unlimited ranges but
> instead to define the limit of memory regions and limit of reserved
> ranges.

A better alternative would be not to limit the number of regions, IMO,
i.e. have an array of regions that can grow as needed.

Regards,
Simon


More information about the U-Boot mailing list