Skip to contentSkip to conversation

vbe: Allow probing the VBE bootmeth to fail in OS fixup

PATCH Superseded Simon Glass 2 participants 2 messages Jan 12, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vbe: Allow probing the VBE bootmeth to fail in OS fixup

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.

---

 boot/vbe_simple_os.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
boot/vbe_simple_os.c +8 -4
index b2041a95a30..3bd0cffc535 100644
@@ -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);
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
#1 lore raw
Quoted 2 lines · Simon Glass

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")
Quoted 16 lines

For now, ignore a probe failure.

---

  boot/vbe_simple_os.c | 12 ++++++++----
  1 file changed, 8 insertions(+), 4 deletions(-)
boot/vbe_simple_os.c +0 -0
index b2041a95a30..3bd0cffc535 100644

boot/vbe_simple_os.c static int bootmeth_vbe_simple_ft_fixup(void *ctx, struct event *event) · line 79

Quoted 8 lines
boot/vbe_simple_os.c +5 -0
@@ -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

Quoted 17 lines
boot/vbe_simple_os.c +3 -4
+			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);