All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick DELAUNAY <patrick.delaunay@st.com>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] fdtgrep: fix fdtgrep_find_regions() error with some device trees
Date: Fri, 10 Jan 2020 07:58:41 +0000	[thread overview]
Message-ID: <d9f7e2ec26c744aa84589c01a56192be@SFHDAG6NODE3.st.com> (raw)
In-Reply-To: <CAPnjgZ1UwGecciu=QocB7wh=a_Yuy=XV4ro=1YowU7Kq6SRDcw@mail.gmail.com>

Hi,

> From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Simon Glass
> Sent: jeudi 9 janvier 2020 21:04
> 
> On Thu, 9 Jan 2020 at 09:35, Anatolij Gustschin <agust@denx.de> wrote:
> >
> > 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.
> >
> > Signed-off-by: Anatolij Gustschin <agust@denx.de>
> > ---
> >  tools/fdtgrep.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> 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

  reply	other threads:[~2020-01-10  7:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-08 20:35 [PATCH 1/2] fdtgrep: fix typos in error output Anatolij Gustschin
2020-01-08 20:35 ` [PATCH 2/2] fdtgrep: fix fdtgrep_find_regions() error with some device trees Anatolij Gustschin
2020-01-09 20:04   ` Simon Glass
2020-01-10  7:58     ` Patrick DELAUNAY [this message]
2020-01-12 19:43       ` Anatolij Gustschin
2020-01-09 20:04 ` [PATCH 1/2] fdtgrep: fix typos in error output Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d9f7e2ec26c744aa84589c01a56192be@SFHDAG6NODE3.st.com \
    --to=patrick.delaunay@st.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.