All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH] fdtdec: fdtdec_get_aliases_highest_id: skip aliases to disabled nodes
Date: Fri, 11 Jun 2021 09:32:31 -0700	[thread overview]
Message-ID: <CAJ+vNU0nuWOjxJJ81kHiWn3uKfBebJBo2zvXzWHCoR3y6FViKg@mail.gmail.com> (raw)
In-Reply-To: <CAJ+vNU3hdLUQJ4TchsTuP2cG7QrXgEwiLkLgsQmqFSQFB4_6kw@mail.gmail.com>

On Thu, Apr 29, 2021 at 9:48 AM Tim Harvey <tharvey@gateworks.com> wrote:
>
> On Thu, Apr 29, 2021 at 9:10 AM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Tim,
> >
> > On Fri, 16 Apr 2021 at 14:30, Tim Harvey <tharvey@gateworks.com> wrote:
> > >
> > > When looking for an alias with the highest id skip aliases for nodes
> > > that are disabled.
> > >
> > > Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> > > ---
> > >  lib/fdtdec.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/lib/fdtdec.c b/lib/fdtdec.c
> > > index 864589193b..d47195525a 100644
> > > --- a/lib/fdtdec.c
> > > +++ b/lib/fdtdec.c
> > > @@ -546,6 +546,8 @@ int fdtdec_get_alias_highest_id(const void *blob, const char *base)
> > >                 if (*prop != '/' || prop[len - 1] ||
> > >                     strncmp(name, base, base_len))
> > >                         continue;
> > > +               if (!fdtdec_get_is_enabled(blob, fdt_path_offset(blob, prop)))
> > > +                       continue;
> >
> > We really can't do this here. It is quite an expensive operation to
> > locate the node for a path.
> >
> > Why is this needed? It seems odd to have an alias pointing to a disabled device.
> >
>
> Simon,
>
> The issue I ran into here was with an imx6 based board that does not
> use the FEC ethernet on the SoC. In this case imx6qdl.dtsi delcares an
> alias 'thernet0 = &fec' yet the fec node is not enabled. However
> because fdtdec_get_alias_highest_id does not skip this alias to a
> disabled device any enumerated ethernet devices get an index of 1
> instead of 0 which is incorrect and causes the mac addresses to be
> misaligned.
>
> In general it is just wrong to reserve id's for disabled devices.
>

Simon,

Do you have any additional feedback on this? It has not been picked up
yet and does cause issues on IMX boards using dm that do not use the
internal SoC's fec ethernet.

Perhaps there is a better way to resolve this?

Best regards,

Tim

  reply	other threads:[~2021-06-11 16:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-16 21:30 [PATCH] fdtdec: fdtdec_get_aliases_highest_id: skip aliases to disabled nodes Tim Harvey
2021-04-29 16:09 ` Simon Glass
2021-04-29 16:48   ` Tim Harvey
2021-06-11 16:32     ` Tim Harvey [this message]
2021-06-11 17:09       ` Sean Anderson
2021-06-11 17:16         ` Tim Harvey
2021-06-11 17:23           ` Sean Anderson
2021-06-11 17:30             ` Tim Harvey
2021-07-04 19:24               ` 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=CAJ+vNU0nuWOjxJJ81kHiWn3uKfBebJBo2zvXzWHCoR3y6FViKg@mail.gmail.com \
    --to=tharvey@gateworks.com \
    --cc=sjg@chromium.org \
    --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.