Skip to contentSkip to conversation

of: overlay: log the error cause on resolver failure

PATCH Applied Luca Ceresoli 4 participants 4 messages Feb 28, 2020 – Mar 2, 2020 Device tree

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 of: overlay: log the error cause on resolver failure

When a DT overlay has a node label that is not present in the live devicetree symbols table, this error is printed:

OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

which does not help much in finding the node label that caused the problem and fix the overlay source.

Add an error message with the name of the node label that caused the error. The new output is:

OF: resolver: node label 'gpio9' not found in live devicetree symbols table
OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

---

Changed in v3:
- add only the message from v1, but as reworded by Frank

Changed in v2:
- add a message for each error path that does not have one yet

---
 drivers/of/resolver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/of/resolver.c +4 -1
index 83c766233181..b278ab4338ce 100644
@@ -321,8 +321,11 @@ int of_resolve_phandles(struct device_node *overlay)
 
 		err = of_property_read_string(tree_symbols,
 				prop->name, &refpath);
-		if (err)
+		if (err) {
+			pr_err("node label '%s' not found in live devicetree symbols table\n",
+			       prop->name);
 			goto out;
+		}
 
 		refnode = of_find_node_by_path(refpath);
 		if (!refnode) {
Signature · 1 line
2.25.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 9 lines · Luca Ceresoli

When a DT overlay has a node label that is not present in the live devicetree symbols table, this error is printed:

OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

which does not help much in finding the node label that caused the problem and fix the overlay source.

Quoted 8 lines

Add an error message with the name of the node label that caused the error. The new output is:

OF: resolver: node label 'gpio9' not found in live devicetree symbols table
OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

Thanks Luca, looks good.

-Frank

Quoted 30 lines

---

Changed in v3:
- add only the message from v1, but as reworded by Frank

Changed in v2:
- add a message for each error path that does not have one yet

---
 drivers/of/resolver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/of/resolver.c +4 -1
index 83c766233181..b278ab4338ce 100644
@@ -321,8 +321,11 @@ int of_resolve_phandles(struct device_node *overlay)
 
 		err = of_property_read_string(tree_symbols,
 				prop->name, &refpath);
-		if (err)
+		if (err) {
+			pr_err("node label '%s' not found in live devicetree symbols table\n",
+			       prop->name);
 			goto out;
+		}
 
 		refnode = of_find_node_by_path(refpath);
 		if (!refnode) {
Reviewed-by on v3 1/1
#2 lore raw
In reply to Luca Ceresoli
Quoted 9 lines · Luca Ceresoli

When a DT overlay has a node label that is not present in the live devicetree symbols table, this error is printed:

OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

which does not help much in finding the node label that caused the problem and fix the overlay source.

Quoted 8 lines

Add an error message with the name of the node label that caused the error. The new output is:

OF: resolver: node label 'gpio9' not found in live devicetree symbols table
OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
maintainer Applied
#3 lore raw
In reply to Luca Ceresoli
Quoted 20 lines · Luca Ceresoli

When a DT overlay has a node label that is not present in the live devicetree symbols table, this error is printed:

OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

which does not help much in finding the node label that caused the problem and fix the overlay source.

Add an error message with the name of the node label that caused the error. The new output is:

OF: resolver: node label 'gpio9' not found in live devicetree symbols table
OF: resolver: overlay phandle fixup failed: -22
create_overlay: Failed to create overlay (err=-22)

---

Quoted 9 lines

Changed in v3:
- add only the message from v1, but as reworded by Frank

Changed in v2:
- add a message for each error path that does not have one yet

---
 drivers/of/resolver.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Applied, thanks.

Rob