All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: Tom Rini <trini@konsulko.com>, u-boot@lists.denx.de
Cc: Lukasz Majewski <lukma@denx.de>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>
Subject: Re: [PATCH] dfu: Make the DFU_WRITE_ALT symbol available outside of DFU
Date: Thu, 12 Mar 2026 10:10:06 +0100	[thread overview]
Message-ID: <875x71mn0x.fsf@kernel.org> (raw)
In-Reply-To: <20260310162621.1163932-1-trini@konsulko.com>

Hi Tom,

Thank you for the patch.

On Tue, Mar 10, 2026 at 10:26, Tom Rini <trini@konsulko.com> wrote:

> The DFU_WRITE_ALT symbol is used both directly and indirectly (via
> UPDATE_COMMON) for EFI capsule updates (FIT or raw), but does not depend
> on DFU itself. Move this symbol outside of "if DFU" to remove a Kconfig
> dependency problem.

Looking at drivers/dfu/dfu_alt.c both dfu_write_by_name() and
dfu_write_by_alt() seem to rely on functions from drivers/dfu/dfu.c such
as dfu_init_env_entities(), dfu_get_entity() and more.

Looking at UPDATE_COMMON, I see:
config UPDATE_COMMON
	bool
	select DFU_WRITE_ALT
	imply CMD_TFTPBOOT

And if we check the code in common/update.c, we can see that
dfu_write_by_name() is called.

So fit_update() calls
   dfu_write_by_name() which calls
       dfu_init_env_entities() which might no longer be defined when
                               applying this patch.

I'm not sure how is this supposed to work. Do we have to stub
dfu_init_env_entities() ?

>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
> Cc: Lukasz Majewski <lukma@denx.de>
> Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
> ---
>  drivers/dfu/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
> index 2cf4289b4486..962bda40ad2d 100644
> --- a/drivers/dfu/Kconfig
> +++ b/drivers/dfu/Kconfig
> @@ -13,10 +13,10 @@ config DFU_OVER_TFTP
>  	bool
>  	depends on NET
>  
> -if DFU
>  config DFU_WRITE_ALT
>  	bool
>  
> +if DFU
>  config DFU_TFTP
>  	bool "DFU via TFTP"
>  	depends on NETDEVICES
> -- 
> 2.43.0

  reply	other threads:[~2026-03-12  9:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-10 16:26 [PATCH] dfu: Make the DFU_WRITE_ALT symbol available outside of DFU Tom Rini
2026-03-12  9:10 ` Mattijs Korpershoek [this message]
2026-03-12 22:58   ` Tom Rini
2026-03-13  8:59     ` Mattijs Korpershoek
2026-03-13 12:56 ` Ilias Apalodimas
2026-03-16  9:39 ` Mattijs Korpershoek

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=875x71mn0x.fsf@kernel.org \
    --to=mkorpershoek@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=lukma@denx.de \
    --cc=trini@konsulko.com \
    --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 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.