U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 11:33:43 -0600	[thread overview]
Message-ID: <20250114173343.GO3476@bill-the-cat> (raw)
In-Reply-To: <20250114165801.GJ3476@bill-the-cat>

[-- Attachment #1: Type: text/plain, Size: 3073 bytes --]

On Tue, Jan 14, 2025 at 10:58:01AM -0600, Tom Rini wrote:
> 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.

So, digging in to this, what's going on is that the platforms I've noted
here (and a few others) don't actually enable any block devices. That's
why, today, with VBE on still, they discard all of the code still. Your
rework means that while there's still no block devices, we're now
including the code. What to do? Both of:
- These platforms *should* disable the assorted block device related
  library options they have enabled if / when possible (it might not be
  a neat and easy un-tangle).
- VBE needs to handle the case where there's not a block device enabled
  and not fail the build. Part of this requires the Kconfig rework I
  linked to earlier (so that we can have BLK off) to be complete, but
  having the VBE code check for BLK being enabled either in Makefile or
  C code should be the same regardless.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2025-01-14 17:33 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
2025-01-14 17:33         ` Tom Rini [this message]
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=20250114173343.GO3476@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