All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vbe: Allow probing the VBE bootmeth to fail in OS fixup
@ 2023-01-12 16:50 Simon Glass
  2023-01-12 21:31 ` Heinrich Schuchardt
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Glass @ 2023-01-12 16:50 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Tom Rini, Simon Glass, Karsten Merker, Heinrich Schuchardt

This device is created when there are no bootmeths defined in the device
tree. But it cannot be probed with a device tree node.

For now, ignore a probe failure.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Karsten Merker <merker@debian.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---

 boot/vbe_simple_os.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/boot/vbe_simple_os.c b/boot/vbe_simple_os.c
index b2041a95a30..3bd0cffc535 100644
--- a/boot/vbe_simple_os.c
+++ b/boot/vbe_simple_os.c
@@ -72,6 +72,14 @@ 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) {
+			log_warning("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 +88,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);
-- 
2.39.0.314.g84b9a713c41-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] vbe: Allow probing the VBE bootmeth to fail in OS fixup
  2023-01-12 16:50 [PATCH] vbe: Allow probing the VBE bootmeth to fail in OS fixup Simon Glass
@ 2023-01-12 21:31 ` Heinrich Schuchardt
  0 siblings, 0 replies; 2+ messages in thread
From: Heinrich Schuchardt @ 2023-01-12 21:31 UTC (permalink / raw)
  To: Simon Glass; +Cc: Tom Rini, Karsten Merker, U-Boot Mailing List

On 1/12/23 17:50, Simon Glass wrote:
> This device is created when there are no bootmeths defined in the device
> tree. But it cannot be probed with a device tree node.

%s/with/without/

(Actually a node is not enough. You also need a bunch of properties, too.)

Fixes: a56f663f0707 ("vbe: Add info about the VBE device to the fwupd node")

>
> For now, ignore a probe failure.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reported-by: Karsten Merker <merker@debian.org>
> Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>
>   boot/vbe_simple_os.c | 12 ++++++++----
>   1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/boot/vbe_simple_os.c b/boot/vbe_simple_os.c
> index b2041a95a30..3bd0cffc535 100644
> --- a/boot/vbe_simple_os.c
> +++ b/boot/vbe_simple_os.c
> @@ -72,6 +72,14 @@ 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) {
> +			log_warning("VBE device '%s' failed to probe (err=%d)",
> +				    dev->name, ret);

I would not like to read this message every time I boot.

log_debug() should be enough.

Best regards

Heinrich

> +			return 0;
> +		}
> +
>   		ret = ofnode_add_subnode(chosen, "fwupd", &node);
>   		if (ret && ret != -EEXIST)
>   			return log_msg_ret("fwu", ret);
> @@ -80,10 +88,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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-12 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-12 16:50 [PATCH] vbe: Allow probing the VBE bootmeth to fail in OS fixup Simon Glass
2023-01-12 21:31 ` Heinrich Schuchardt

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.