[PATCH v2] vbe: Allow probing the VBE bootmeth to fail in OS fixup

Vagrant Cascadian vagrant at debian.org
Sun Jan 15 04:08:09 CET 2023


On 2023-01-12, Simon Glass wrote:
> This device is created when there are no bootmeths defined in the device
> tree. But it cannot be probed without a device tree node.
>
> For now, ignore a probe failure.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> Reported-by: Karsten Merker <merker at debian.org>
> Suggested-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Fixes: a56f663f0707 ("vbe: Add info about the VBE device to the fwupd node")

I was able to reproduce the issue using the qemu-riscv64 instructions
Karsten provided, and applying the patch fixes it, thanks!

Tested-by: Vagrant Cascadian <vagrant at debian.org>

live well,
  vagrant

> ---
>
> Changes in v2:
> - With 'with' typo
> - Change to a debug message and add a comment
>
>  boot/vbe_simple_os.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/boot/vbe_simple_os.c b/boot/vbe_simple_os.c
> index b2041a95a30..8c641ec07e2 100644
> --- a/boot/vbe_simple_os.c
> +++ b/boot/vbe_simple_os.c
> @@ -72,6 +72,18 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event)
>  		chosen = oftree_path(tree, "/chosen");
>  		if (!ofnode_valid(chosen))
>  			continue;
> +
> +		ret = device_probe(dev);
> +		if (ret) {
> +			/*
> +			 * This should become an error when VBE is updated to
> +			 * only bind this device when a node exists
> +			 */
> +			log_debug("VBE device '%s' failed to probe (err=%d)",
> +				  dev->name, ret);
> +			return 0;
> +		}
> +
>  		ret = ofnode_add_subnode(chosen, "fwupd", &node);
>  		if (ret && ret != -EEXIST)
>  			return log_msg_ret("fwu", ret);
> @@ -80,10 +92,6 @@ static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event)
>  		if (ret && ret != -EEXIST)
>  			return log_msg_ret("dev", ret);
>  
> -		ret = device_probe(dev);
> -		if (ret)
> -			return log_msg_ret("probe", ret);
> -
>  		/* Copy over the vbe properties for fwupd */
>  		log_debug("Fixing up: %s\n", dev->name);
>  		ret = ofnode_copy_props(dev_ofnode(dev), subnode);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20230114/acdbd684/attachment.sig>


More information about the U-Boot mailing list