All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Harvey <tharvey@gateworks.com>
To: u-boot@lists.denx.de
Subject: [PATCH 6/6] net: octeontx: smi: fix mii probe
Date: Thu, 29 Apr 2021 07:27:09 -0700	[thread overview]
Message-ID: <CAJ+vNU2-nWE=sF1j4i7QjGmmx2yJgUNHFVZ6tdz1-zaASrEi-A@mail.gmail.com> (raw)
In-Reply-To: <16361117-ae8e-fbd1-a67e-d15a0e90b892@denx.de>

On Wed, Apr 28, 2021 at 10:21 PM Stefan Roese <sr@denx.de> wrote:
>
> Hi Tim,
>
> On 28.04.21 17:11, Tim Harvey wrote:
> > On Mon, Apr 26, 2021 at 10:19 PM Stefan Roese <sr@denx.de> wrote:
> >>
> >> Hi Tim,
> >>
> >> On 26.03.21 16:55, Tim Harvey wrote:
> >>> On Thu, Mar 25, 2021 at 11:48 PM Stefan Roese <sr@denx.de> wrote:
> >>>>
> >>>> On 26.03.21 01:07, Tim Harvey wrote:
> >>>>> The fdt node offset is apparently not set properly when probed
> >>>>> causing no MDIO busses to be found. Fix this by obtaining the
> >>>>> offset.
> >>>>>
> >>>>> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
> >>>>
> >>>> Reviewed-by: Stefan Roese <sr@denx.de>
> >>>>
> >>>> Thanks,
> >>>> Stefan
> >>>>
> >>>>> ---
> >>>>>     drivers/net/octeontx/smi.c | 2 ++
> >>>>>     1 file changed, 2 insertions(+)
> >>>>>
> >>>>> diff --git a/drivers/net/octeontx/smi.c b/drivers/net/octeontx/smi.c
> >>>>> index 91dcd05e4b..27f4423c6a 100644
> >>>>> --- a/drivers/net/octeontx/smi.c
> >>>>> +++ b/drivers/net/octeontx/smi.c
> >>>>> @@ -325,6 +325,8 @@ int octeontx_smi_probe(struct udevice *dev)
> >>>>>                 return -1;
> >>>>>         }
> >>>>>
> >>>>> +     node = fdt_node_offset_by_compatible(gd->fdt_blob, -1,
> >>>>> +                                          "cavium,thunder-8890-mdio-nexus");
> >>>>>         fdt_for_each_subnode(subnode, gd->fdt_blob, node) {
> >>>>>                 ret = fdt_node_check_compatible(gd->fdt_blob, subnode,
> >>>>>                                                 "cavium,thunder-8890-mdio");
> >>>>>
> >>>
> >>> Honestly this is the wrong fix for this issue and I'm hoping someone
> >>> could educate me. I'm a bit confused at why there are several ways to
> >>> work with dt (int offsets vs ofnodes which are unions of int offsets
> >>> and node pointers???).
> >>>
> >>> The above patch was not needed previously so something changed in the
> >>> ofnode field of struct udevice between v2019.10 and v2021.01.
> >>>
> >>> Simon, could you explain what the proper way to work with dev->ofnode
> >>> in probe functions is to loop over subnodes?
> >>
> >> This version is in mainline now. Tim, could you please re-visit this
> >> and perhaps switch to using live tree API, as suggested by Suneel:
> >>
> >>          ofnode_for_each_subnode(subnode, dev_ofnode(dev)) {
> >>                  ret = ofnode_device_is_compatible(subnode,
> >>                          "cavium,thunder-8890-mdio");
> >>
> >
> > Stefan,
> >
> > Yes, I can submit this but I would really like to understand the
> > original issue. Do you or Simon perhaps know why the fdt node offset
> > in dev passed to probe is wrong? It's not null but it does not appear
> > to point to a device-tree (or perhaps I was using the wrong functions
> > on it not fully understanding the current state of this live tree
> > API).
>
> I don't have an OcteonTX board installed right now, so it's not easy to
> really verify this. AFAIU, fdt_for_each_subnode() etc is deprecated and
> the use of e.g. this API seems "more modern":
>
>         ofnode subnode;
>
>         dev_for_each_subnode(subnode, dev) {
>                 ...
>
> Does this work for you?
>

Stefan,

Yes thanks - I didn't read your original suggestion closely enough. I
have a patch I will submit.

Thanks,

Tim

  reply	other threads:[~2021-04-29 14:27 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  0:07 [PATCH 0/6] octeontx cleanup and fixes Tim Harvey
2021-03-26  0:07 ` [PATCH 1/6] arm: octeontx: move CONFIG_SUPPORT_RAW_INITRD to configs Tim Harvey
2021-03-26  6:38   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 2/6] arm: octeontx: support generic distro config Tim Harvey
2021-03-26  6:44   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 3/6] arm: octeontx: enable WDT_SBSA Tim Harvey
2021-03-26  6:44   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 4/6] drivers: net: octeontx: fix QSGMII Tim Harvey
2021-03-26  6:46   ` Stefan Roese
2021-03-26 16:08     ` Suneel Garapati
2021-03-26 16:37       ` Tim Harvey
2021-03-26 16:39         ` Suneel Garapati
2021-04-08 19:55           ` Tim Harvey
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 5/6] drivers: ata: ahci: update max id if it is more than available ports Tim Harvey
2021-03-26  6:47   ` Stefan Roese
2021-04-20 14:20   ` Tom Rini
2021-03-26  0:07 ` [PATCH 6/6] net: octeontx: smi: fix mii probe Tim Harvey
2021-03-26  6:48   ` Stefan Roese
2021-03-26 15:55     ` Tim Harvey
2021-03-26 16:03       ` Suneel Garapati
2021-04-27  5:19       ` Stefan Roese
2021-04-28 15:11         ` Tim Harvey
2021-04-29  5:21           ` Stefan Roese
2021-04-29 14:27             ` Tim Harvey [this message]
2021-04-20 14:20   ` Tom Rini
2021-03-26  6:49 ` [PATCH 0/6] octeontx cleanup and fixes Stefan Roese
2021-03-26 15:51   ` Tim Harvey

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+vNU2-nWE=sF1j4i7QjGmmx2yJgUNHFVZ6tdz1-zaASrEi-A@mail.gmail.com' \
    --to=tharvey@gateworks.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.