Skip to contentSkip to conversation

fdtgrep: fix typos in error output

PATCH New Anatolij Gustschin 3 participants 6 messages Jan 8, 2020 – Jan 12, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 fdtgrep: fix typos in error output

Fix function name and parenthesis.

---
 tools/fdtgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fdtgrep.c +1 -1
index 8f44f599c1..052d419692 100644
@@ -824,7 +824,7 @@ static int do_fdtgrep(struct display_info *disp, const char *filename)
 		if (count <= max_regions)
 			break;
 		free(region);
-		fprintf(stderr, "Internal error with fdtgrep_find_region)(\n");
+		fprintf(stderr, "Internal error with fdtgrep_find_regions()\n");
 		return -1;
 	}
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 fdtgrep: fix fdtgrep_find_regions() error with some device trees

With some device trees (i.e. i.MX6 SoC) and longer REMOVE_PROPS list the fdtgrep tool stops with "Internal error with fdtgrep_find_regions()". Increase 'max_regions' count to avoid such errors.

---
 tools/fdtgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/fdtgrep.c +1 -1
index 052d419692..8f71b1cd7f 100644
@@ -778,7 +778,7 @@ static int do_fdtgrep(struct display_info *disp, const char *filename)
 {
 	struct fdt_region *region = NULL;
 	int max_regions;
-	int count = 100;
+	int count = 110;
 	char path[1024];
 	char *blob;
 	int i, ret;
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 fdtgrep: fix fdtgrep_find_regions() error with some device trees

Quoted 9 lines · Anatolij Gustschin

With some device trees (i.e. i.MX6 SoC) and longer REMOVE_PROPS list the fdtgrep tool stops with "Internal error with fdtgrep_find_regions()". Increase 'max_regions' count to avoid such errors.

---
 tools/fdtgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Wow that's a lot. I wonder if we should adjust it to be unlimited?

#3 lore raw

PATCH 2/2 fdtgrep: fix fdtgrep_find_regions() error with some device trees

Hi,

Quoted 9 lines

From: U-Boot <[email protected]> On Behalf Of Simon Glass
Sent: jeudi 9 janvier 2020 21:04

Quoted 5 lines · Anatolij Gustschin

With some device trees (i.e. i.MX6 SoC) and longer REMOVE_PROPS list the fdtgrep tool stops with "Internal error with fdtgrep_find_regions()". Increase 'max_regions' count to avoid such errors.

Quoted 8 lines
Quoted 4 lines
---
 tools/fdtgrep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Wow that's a lot. I wonder if we should adjust it to be unlimited?

I see the same issue for device-tree when number of pincontrol node > 100 in SPL (only see for debug use case).

But normally it is managed in the function
(2 loops and re-alloc for the second loop if size > 100).

But the loop is not correctly managed, I think it is a issue introduced by Commit e178db1d7736a92951fdc7f1fd9b8ecf4d2877ba
fdtgrep: Fix logic of free() in do_fdtgrep()

=> retrun -1 added for the 1rst loop.

I have locally a patch, but I don't yet upstream it.... It is done today with:

	"tools: ftdgrep: correct the find regions loop in do_fdtgrep"
	http://patchwork.ozlabs.org/project/uboot/list/?series=152371

Anatolij can you confirm that my patch correct also your issue ?

Regards

Patrick

#4 lore raw

PATCH 2/2 fdtgrep: fix fdtgrep_find_regions() error with some device trees

Hi Patrick,

On Fri, 10 Jan 2020 07:58:41 +0000
Patrick DELAUNAY patrick.delaunay at st.com wrote:
...

Quoted 6 lines

I have locally a patch, but I don't yet upstream it.... It is done today with:

	"tools: ftdgrep: correct the find regions loop in do_fdtgrep"
	http://patchwork.ozlabs.org/project/uboot/list/?series=152371

Anatolij can you confirm that my patch correct also your issue ?

Yes, your patch helps. Thanks!

--
Anatolij