Skip to contentSkip to conversation

Revert "dm: fdt: scan for devices under /firmware too"

PATCH New Thirupathaiah Annapureddy 2 participants 2 messages Feb 17, 2020 – Feb 18, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "dm: fdt: scan for devices under /firmware too"

Subnodes under "/firmware" node are scanned twice in dm_scan_fdt_node() and dm_extended_scan_fdt(). This patch removes the scanning in dm_scan_fdt_node() to avoid double scanning.

This reverts commit 747558d014577526bf2e8d9fe9ca748fdbf75d8a.

---
 drivers/core/root.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/core/root.c +5 -10
index e85643819e..cb695e933a 100644
@@ -254,15 +254,9 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 	for (offset = fdt_first_subnode(blob, offset);
 	     offset > 0;
 	     offset = fdt_next_subnode(blob, offset)) {
-		const char *node_name = fdt_get_name(blob, offset, NULL);
-
-		/*
-		 * The "chosen" and "firmware" nodes aren't devices
-		 * themselves but may contain some:
-		 */
-		if (!strcmp(node_name, "chosen") ||
-		    !strcmp(node_name, "firmware")) {
-			pr_debug("parsing subnodes of \"%s\"\n", node_name);
+		/* "chosen" node isn't a device itself but may contain some: */
+		if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) {
+			pr_debug("parsing subnodes of \"chosen\"\n");
 
 			err = dm_scan_fdt_node(parent, blob, offset,
 					       pre_reloc_only);
@@ -279,7 +273,8 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 				     pre_reloc_only);
 		if (err && !ret) {
 			ret = err;
-			debug("%s: ret=%d\n", node_name, ret);
+			debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
+			      ret);
 		}
 	}
 
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/1 Revert "dm: fdt: scan for devices under /firmware too"

Quoted 36 lines · Thirupathaiah Annapureddy

Subnodes under "/firmware" node are scanned twice in dm_scan_fdt_node() and dm_extended_scan_fdt(). This patch removes the scanning in dm_scan_fdt_node() to avoid double scanning.

This reverts commit 747558d014577526bf2e8d9fe9ca748fdbf75d8a.

---
 drivers/core/root.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/core/root.c +3 -9
index e85643819e..cb695e933a 100644
@@ -254,15 +254,9 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 	for (offset = fdt_first_subnode(blob, offset);
 	     offset > 0;
 	     offset = fdt_next_subnode(blob, offset)) {
-		const char *node_name = fdt_get_name(blob, offset, NULL);
-
-		/*
-		 * The "chosen" and "firmware" nodes aren't devices
-		 * themselves but may contain some:
-		 */
-		if (!strcmp(node_name, "chosen") ||
-		    !strcmp(node_name, "firmware")) {
-			pr_debug("parsing subnodes of \"%s\"\n", node_name);
+		/* "chosen" node isn't a device itself but may contain some: */
+		if (!strcmp(fdt_get_name(blob, offset, NULL), "chosen")) {
+			pr_debug("parsing subnodes of \"chosen\"\n");
 
 			err = dm_scan_fdt_node(parent, blob, offset,
 					       pre_reloc_only);

drivers/core/root.c static int dm_scan_fdt_node(struct udevice *parent, const void *blob, · line 279

Quoted 8 lines
drivers/core/root.c +2 -1
@@ -279,7 +273,8 @@ static int dm_scan_fdt_node(struct udevice *parent, const void *blob,
 				     pre_reloc_only);
 		if (err && !ret) {
 			ret = err;
-			debug("%s: ret=%d\n", node_name, ret);
+			debug("%s: ret=%d\n", fdt_get_name(blob, offset, NULL),
+			      ret);
 		}
 	}

This has come up several times. Please join this thread which is fixing this issue.
https://lists.denx.de/pipermail/u-boot/2020-February/400165.html

Thanks,
Michal

Signature · 14 lines
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200218/c7d844c9/attachment.sig>