All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: u-boot@lists.denx.de, Alexander Graf <agraf@csgraf.de>
Subject: Re: [PATCH] efidebug: avoid 'dfu_alt_info not defined' message
Date: Mon, 17 Jan 2022 09:45:23 +0900	[thread overview]
Message-ID: <20220117004523.GA7045@laputa> (raw)
In-Reply-To: <20220115011821.87588-1-heinrich.schuchardt@canonical.com>

On Sat, Jan 15, 2022 at 02:18:21AM +0100, Heinrich Schuchardt wrote:
> If variable dfu_alt_info is not defined duplicate messages are displayed.
> 
>     => efidebug boot dump
>     Scanning disk mmc2.blk...
>     Scanning disk mmc1.blk...
>     Scanning disk mmc0.blk...
>     Found 3 disks
>     No EFI system partition
>     "dfu_alt_info" env variable not defined!
>     Probably dfu_alt_info not defined
>     "dfu_alt_info" env variable not defined!
>     Probably dfu_alt_info not defined
> 
> Remove the 'Probably dfu_alt_info not defined' message.
> Instead write a warning if the variable contains no entities.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  lib/efi_loader/efi_firmware.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
> index a1b88dbfc2..519a47267c 100644
> --- a/lib/efi_loader/efi_firmware.c
> +++ b/lib/efi_loader/efi_firmware.c
> @@ -128,8 +128,11 @@ static efi_status_t efi_get_dfu_info(
>  	size_t names_len, total_size;
>  	int dfu_num, i;
>  	u16 *name, *next;
> +	int ret;
>  
> -	dfu_init_env_entities(NULL, NULL);
> +	ret = dfu_init_env_entities(NULL, NULL);
> +	if (ret)
> +		return EFI_SUCCESS;

Do you want to return EFI_SUCCESS here?
It is mandatory that "dfu_alt_info" be defined so that the current
FMP drivers should work.
So if the variable is not defined, I think,
efi_firmware_[fit|raw]_get_image_info() should fail.
Even if it returns EFI_SUCCESS, descriptor_count should be set to zero.

-Takahiro Akashi

>  	names_len = 0;
>  	dfu_num = 0;
> @@ -138,7 +141,7 @@ static efi_status_t efi_get_dfu_info(
>  		dfu_num++;
>  	}
>  	if (!dfu_num) {
> -		log_warning("Probably dfu_alt_info not defined\n");
> +		log_warning("No entities in dfu_alt_info\n");
>  		*image_info_size = 0;
>  		dfu_free_entities();
>  
> -- 
> 2.33.1
> 

  reply	other threads:[~2022-01-17  0:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15  1:18 [PATCH] efidebug: avoid 'dfu_alt_info not defined' message Heinrich Schuchardt
2022-01-17  0:45 ` AKASHI Takahiro [this message]
2022-01-17 12:33   ` Heinrich Schuchardt
2022-01-18  1:08     ` AKASHI Takahiro

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=20220117004523.GA7045@laputa \
    --to=takahiro.akashi@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=heinrich.schuchardt@canonical.com \
    --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 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.