From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Julien Masson <jmasson@baylibre.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>
Subject: Re: [PATCH 01/15] vbe: Split out some VBE code into a common file
Date: Tue, 14 Jan 2025 10:58:01 -0600 [thread overview]
Message-ID: <20250114165801.GJ3476@bill-the-cat> (raw)
In-Reply-To: <CAFLszTj9zAE_KniCZ2xHGHt1fK7jhTBHzfkdSif6XNuzKtWOTA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3210 bytes --]
On Tue, Jan 14, 2025 at 05:58:04AM -0700, Simon Glass wrote:
> Hi Tom,
>
> On Mon, 13 Jan 2025 at 18:22, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Thu, Jan 09, 2025 at 05:29:56AM -0700, Simon Glass wrote:
> >
> > > Loading a FIT is useful for other VBE methods, such as ABrec, so start
> > > a new common file. Add functions for reading the version and nvdata.
> > > Also add a function to get the block device.
> >
> > This is not a good commit message when you're also introducing
> > functional changes (blk_dread -> blk_read).
>
> Yes, I did not actually notice this size change at all, as mentioned,
> as I only built for a few boards (firefly rk3399/rk3288 and a few
> sandbox ones). The blk_dread() function is the old API for reading
You have much faster build machines available than I do, it would be
good to run a world build before/after (it might take an hour on
alexandra) before posting these big series.
> from a block. It didn't occur to me that blk_dread() would bypass the
> cache.
Yes, how is that happening? That's what doesn't make sense.
>
> > Further, this functional
> > change seems to introduce some other code being pulled in very
> > unexpectedly, and that needs to be explained. For example,
> > phycore_am62x_r5_usbdfu is another case and that has
> > CONFIG_BLOCK_CACHE=y but CONFIG_SPL_BLOCK_CACHE=n, and yet the size
> > growth is in full U-Boot.
>
> This board currently uses blk_dread(), but not blk_read(), so the
> addition of a blk_read() call in non-SPL causes the BLK cache to be
> pulled in.
But, how? I mean, this sounds like some underlying bug that needs to be
fixed. The platform sets CONFIG_BLK=y and CONFIG_BLOCK_CACHE=y and
drivers/block/blk-uclass.c has:
ulong blk_dread(struct blk_desc *desc, lbaint_t start, lbaint_t blkcnt,
void *buffer)
{
return blk_read(desc->bdev, start, blkcnt, buffer);
}
Or perhaps the answer / problem here is that I need to track down what's
going wrong here instead of asking you to track this down.
> > Just moving code should not result in
> > unexpected size change.
>
> That's correct, so long as 'expected' size changes includes the normal
> function-call overhead and loss of intra-module optimisation.
Yes, but that's not what this series shows. There's (a) the above bug
and (b) you might be allocating buffers twice now instead of once?
> So, what to do here? I certainly don't want to use the old blk API.
Yes. I'm not 100% sure, especially after
https://patchwork.ozlabs.org/project/uboot/list/?series=437816&state=*
which I need to v2 what the non-SPL case is. And for new features, sure,
saying SPL_BLK is required too is fine. Heck, it *may* even be the case
that only TPL_BLK=n is required to be valid, all of that would require
other investigation and removals.
> But I can perhaps do a patch which changes VBE to use the new one,
> first, so the size growth is within that commit. I looked up
> BLOCK_CACHE and it is used by 90% of boards.
Yes, BLOCK_CACHE should be used by everyone at this point, it was one of
those cases of "this grows the code but it's a universal speedup".
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2025-01-14 16:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 12:29 [PATCH 00/15] vbe: Series part F Simon Glass
2025-01-09 12:29 ` [PATCH 01/15] vbe: Split out some VBE code into a common file Simon Glass
2025-01-14 1:22 ` Tom Rini
2025-01-14 12:58 ` Simon Glass
2025-01-14 13:26 ` Simon Glass
2025-01-14 16:58 ` Tom Rini [this message]
2025-01-14 17:33 ` Tom Rini
2025-01-15 1:18 ` Simon Glass
2025-01-15 1:41 ` Tom Rini
2025-01-15 2:48 ` Simon Glass
2025-01-15 14:10 ` Simon Glass
2025-01-09 12:29 ` [PATCH 02/15] vbe: Split out reading a FIT " Simon Glass
2025-01-11 22:54 ` Tom Rini
2025-01-13 20:03 ` Simon Glass
2025-01-13 20:44 ` Tom Rini
2025-01-14 0:13 ` Simon Glass
2025-01-14 1:22 ` Tom Rini
2025-01-15 14:43 ` Tom Rini
2025-01-15 23:21 ` Simon Glass
2025-01-09 12:29 ` [PATCH 03/15] vbe: Allocate space for the FIT header Simon Glass
2025-01-09 12:29 ` [PATCH 04/15] vbe: Allow VBE to load FITs on any architecture Simon Glass
2025-01-09 12:30 ` [PATCH 05/15] vbe: Tidy up error checking with blk_read() Simon Glass
2025-01-09 12:30 ` [PATCH 06/15] vbe: Handle loading from an unaligned offset Simon Glass
2025-01-09 12:30 ` [PATCH 07/15] vbe: Allow loading loadables if there is no firmware Simon Glass
2025-01-09 12:30 ` [PATCH 08/15] vbe: Support loading an FDT from the FIT Simon Glass
2025-01-09 12:30 ` [PATCH 09/15] spl: Add fields for VBE Simon Glass
2025-01-09 12:30 ` [PATCH 10/15] spl: Add a type for the jumper function Simon Glass
2025-01-09 12:30 ` [PATCH 11/15] spl: Add support for a relocating jump to the next phase Simon Glass
2025-01-09 12:30 ` [PATCH 12/15] spl: Plumb in the relocating loader Simon Glass
2025-01-09 12:30 ` [PATCH 13/15] vbe: Support loading an FDT with " Simon Glass
2025-01-09 12:30 ` [PATCH 14/15] vbe: Support loading SPL images Simon Glass
2025-01-09 12:30 ` [PATCH 15/15] vbe: Update simple-fw to support using the SPL loader Simon Glass
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=20250114165801.GJ3476@bill-the-cat \
--to=trini@konsulko.com \
--cc=jmasson@baylibre.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=mkorpershoek@baylibre.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.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