All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Valla <francesco@valla.it>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,
	 Quentin Schulz <quentin.schulz@cherry.de>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	 James Hilliard <james.hilliard1@gmail.com>,
	Julien Stephan <jstephan@baylibre.com>,
	 Frank Wunderlich <frank-w@public-files.de>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	 Kunihiko Hayashi <hayashi.kunihiko@socionext.com>,
	Anshul Dalal <anshuld@ti.com>,
	Leo Yu-Chi Liang <ycliang@andestech.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	 Ronald Wahl <ronald.wahl@legrand.com>,
	Dhruva Gole <d-gole@ti.com>,
	 Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>,
	Rasmus Villemoes <ravi@prevas.dk>,
	 Michael Walle <mwalle@kernel.org>,
	Marek Vasut <marek.vasut@mailbox.org>,
	 Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Genoud <richard.genoud@bootlin.com>,
	 Wolfgang Wallner <wolfgang.wallner@at.abb.com>,
	David Lechner <dlechner@baylibre.com>
Subject: Re: [PATCH 2/5] boot: fit: decompress kernel when in SPL
Date: Mon, 4 May 2026 19:34:21 +0200	[thread overview]
Message-ID: <afjYP8Pdwj0aeIWF@bywater> (raw)
In-Reply-To: <CAFLszThh9zfED4VdR=vfkTisGMqdmRm26JtrJhh7rjQiLSn1VQ@mail.gmail.com>

Hi Simon,

On Mon, May 04, 2026 at 06:08:40AM -0600, Simon Glass wrote:
> Hi Francesco,
> 
> On 2026-04-28T20:24:41, Francesco Valla <francesco@valla.it> wrote:
> > boot: fit: decompress kernel when in SPL
> >
> > During the esecution of fit_image_load() in full U-Boot, the kernel is
> > not decompressed as this step is typically performed by the bootm
> > command logic afterward. This is not however true when doing a falcon
> > boot from SPL; enable the decompression in this case (i.e., if
> > CONFIG_SPL_OS_BOOT is set).
> >
> > Signed-off-by: Francesco Valla <francesco@valla.it>
> >
> > boot/image-fit.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> > diff --git a/boot/image-fit.c b/boot/image-fit.c
> > @@ -2291,9 +2291,10 @@ int fit_image_load(struct bootm_headers *images, ulong addr,
> > +         image_type != IH_TYPE_RAMDISK &&
> > +         (CONFIG_IS_ENABLED(OS_BOOT) ||
> > +          image_type != IH_TYPE_KERNEL ||
> > +          image_type != IH_TYPE_KERNEL_NOLOAD)) {
> 
> Since image_type can never be both IH_TYPE_KERNEL and
> IH_TYPE_KERNEL_NOLOAD at the same time, (image_type != IH_TYPE_KERNEL
> || image_type != IH_TYPE_KERNEL_NOLOAD) is always true, the kernel is
> decompressed unconditionally, including in U-Boot proper, which is
> what the original code was trying to avoid.
> 
> I think you want:
> 
>     (CONFIG_IS_ENABLED(OS_BOOT) ||
>      (image_type != IH_TYPE_KERNEL &&
>       image_type != IH_TYPE_KERNEL_NOLOAD))
>

This was exactly the first version, then I tried to simplify the logic
and quite obviously failed. I'll fix it for v2.

> Can you see a way to add a test that exercises this path so the
> regression would be caught?
> 
> > During the esecution of fit_image_load() in full U-Boot, the kernel is
> 
> execution
> 
> It is worth mentioning mention in the commit message that you rely on
> CONFIG_IS_ENABLED(OS_BOOT) being false in U-Boot proper (since only
> CONFIG_SPL_OS_BOOT exists), so existing behaviour is preserved there.
> 

Ok

> Regards,
> Simon

Thank you

Regards,
Francesco

  reply	other threads:[~2026-05-04 17:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 20:24 [PATCH 0/5] Enhance the SPL FIT "full" loading logic Francesco Valla
2026-04-28 20:24 ` [PATCH 1/5] boot: fit: fix FIT verification in SPL Francesco Valla
2026-05-04 12:08   ` Simon Glass
2026-04-28 20:24 ` [PATCH 2/5] boot: fit: decompress kernel when " Francesco Valla
2026-05-04 12:08   ` Simon Glass
2026-05-04 17:34     ` Francesco Valla [this message]
2026-04-28 20:24 ` [PATCH 3/5] boot: fit: enable FIT image post-processing " Francesco Valla
2026-05-04 12:08   ` Simon Glass
2026-05-07 16:17   ` Quentin Schulz
2026-05-07 20:18     ` Francesco Valla
2026-04-28 20:24 ` [PATCH 4/5] spl: call ft_board_setup() and ft_system_setup() if enabled Francesco Valla
2026-05-04 12:09   ` Simon Glass
2026-05-04 17:39     ` Francesco Valla
2026-04-28 20:24 ` [PATCH 5/5] spl: fit: add ramdisk load Francesco Valla
2026-05-04 12:09   ` Simon Glass
2026-05-04 17:47     ` Francesco Valla
2026-05-04 12:07 ` [0/5] Enhance the SPL FIT "full" loading logic Simon Glass
2026-05-04 17:32   ` Francesco Valla

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=afjYP8Pdwj0aeIWF@bywater \
    --to=francesco@valla.it \
    --cc=andrew.goodbody@linaro.org \
    --cc=anshuld@ti.com \
    --cc=d-gole@ti.com \
    --cc=dlechner@baylibre.com \
    --cc=frank-w@public-files.de \
    --cc=hayashi.kunihiko@socionext.com \
    --cc=james.hilliard1@gmail.com \
    --cc=jstephan@baylibre.com \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=marek.vasut@mailbox.org \
    --cc=mikhail.kshevetskiy@iopsys.eu \
    --cc=miquel.raynal@bootlin.com \
    --cc=mwalle@kernel.org \
    --cc=quentin.schulz@cherry.de \
    --cc=ravi@prevas.dk \
    --cc=richard.genoud@bootlin.com \
    --cc=ronald.wahl@legrand.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=wolfgang.wallner@at.abb.com \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.