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>
Subject: Re: [PATCH 02/15] vbe: Split out reading a FIT into a common file
Date: Mon, 13 Jan 2025 19:22:19 -0600	[thread overview]
Message-ID: <20250114012219.GF3476@bill-the-cat> (raw)
In-Reply-To: <CAFLszTjo1FcHL4G76u1tS3caEgdpk7FHdstoXe+AhERO8rJJfg@mail.gmail.com>

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

On Mon, Jan 13, 2025 at 05:13:46PM -0700, Simon Glass wrote:
> Hi Tom,
> 
> On Mon, 13 Jan 2025 at 13:44, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Mon, Jan 13, 2025 at 01:03:52PM -0700, Simon Glass wrote:
> > > Hi Tom,
> > >
> > > On Sat, 11 Jan 2025 at 15:54, Tom Rini <trini@konsulko.com> wrote:
> > > >
> > > > On Thu, Jan 09, 2025 at 05:29:57AM -0700, Simon Glass wrote:
> > > >
> > > > > Loading a FIT is useful for other VBE methods, such as ABrec. Create a
> > > > > new function to handling reading it.
> > > > >
> > > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > >
> > > > This causes a bunch of growth:
> > > >             a3y17lte       : all +1328 text +1328
> > > >                u-boot: add: 8/0, grow: 1/0 bytes: 1328/0 (1328)
> > > >                  function                                   old     new   delta
> > > >                  blkcache_fill                                -     332    +332
> > > >                  blkcache_read                                -     240    +240
> > > >                  blk_read                                     -     188    +188
> > > >                  vbe_read_nvdata                              -     156    +156
> > > >                  vbe_read_version                             -     140    +140
> > > >                  vbe_get_blk                                  -     100    +100
> > > >                  simple_read_nvdata                           -      96     +96
> > > >                  crc8                                         -      72     +72
> > > >                  vbe_simple_read_state                      108     112      +4
> > > >
> > > > Which is unexpected for just moving code around that's not newly used.
> > >
> > > I hadn't noticed that on the boards I was trying, so thank you for spotting it.
> > >
> > > This is because it now uses blk_read() instead of blk_dread(), so if
> >
> > That's not what this patch does? There's no caller before or after in
> > this patch of "blk_dread". Just moving functions around should not
> > increase size on platforms that weren't using the existing
> > functionality.
> 
> Firstly, are we looking at the same patch? Here is the one I am looking at:
> 
> https://patchwork.ozlabs.org/project/uboot/patch/20250109123010.4005298-2-sjg@chromium.org/

You're right, I replied to the wrong patch here, sorry for the
confusion. I'll move some of my comments in reply to the correct patch
now.

[snip]
> > > > And even when it's just a move it's still growing:
> > > >             xilinx_zynqmp_virt: all +128 bss -72 text +200
> > > >                u-boot: add: 4/0, grow: 0/-1 bytes: 540/-340 (200)
> > > >                  function                                   old     new   delta
> > > >                  vbe_read_nvdata                              -     156    +156
> > > >                  vbe_get_blk                                  -     148    +148
> > > >                  vbe_read_version                             -     140    +140
> > > >                  simple_read_nvdata                           -      96     +96
> > > >                  vbe_simple_read_state                      452     112    -340
> > >
> > > Unfortunately this one is hard to fix. As you know, whenever you take
> > > code from a single module and put it into another, the compiler cannot
> > > optimise away the function-call overhead. I'll note that there is no
> > > increase when LTO is used, e.g. with xilinx_versal_net_mini_qspi

Yes, but 200 bytes isn't just function call overhead. Some of that might
be from going from one ALLOC_CACHE_ALIGN_BUFFER(u8, buf,
MMC_MAX_BLOCK_LEN) to two?

> > > So let me know what you think.
> >
> > You likely need to re-think your refactor a bit then. If it's in part G
> > or H that we have more than one caller of any of these functions, that's
> > perhaps where it's time to refactor and expose them?
> 
> Yes of course I can move things around. I would need to drop the FIT
> loader as well, so this series would become quite small. Shall I do
> that for the next version?
> 
> But just so that I understand...in the next series, when abrec is
> added, and I have these same patches, will you accept this size
> increase?

It sounds like you're talking about re-ordering patches and I'm asking
you to re-work your re-work of the code so that it doesn't grow things
without explanation, and minimizes growth. Maybe that's code changes,
maybe that's better commit messages, likely it's a combination of both.

-- 
Tom

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

  reply	other threads:[~2025-01-14  1:22 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
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 [this message]
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=20250114012219.GF3476@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=sjg@chromium.org \
    --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