All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Saravana Kannan <saravanak@google.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rob Herring" <robh+dt@kernel.org>,
	"Frank Rowand" <frowand.list@gmail.com>,
	"Hervé Codina" <herve.codina@bootlin.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	kernel-team@android.com, "Rob Herring" <robh@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of: property: fw_devlink: Fix stupid bug in remote-endpoint parsing
Date: Thu, 14 Mar 2024 22:50:52 -0700	[thread overview]
Message-ID: <CAGETcx9nohVEisxoBDB7Q6eVUv3mx7W50g-Ujx+L-iN=hcKGrw@mail.gmail.com> (raw)
In-Reply-To: <CAMuHMdV-P9nt1htpn-+jicUMA_JsOpf6mszajP9qORNweicLLw@mail.gmail.com>

On Thu, Mar 14, 2024 at 1:46 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> Hi Saravana,
>
> On Thu, Mar 14, 2024 at 2:48 AM Saravana Kannan <saravanak@google.com> wrote:
> > On Thu, Feb 29, 2024 at 2:11 AM Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > > On Sat, Feb 24, 2024 at 6:25 AM Saravana Kannan <saravanak@google.com> wrote:
> > > > Introduced a stupid bug in commit 782bfd03c3ae ("of: property: Improve
> > > > finding the supplier of a remote-endpoint property") due to a last minute
> > > > incorrect edit of "index !=0" into "!index". This patch fixes it to be
> > > > "index > 0" to match the comment right next to it.
> > > >
> > > > Reported-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
> > > > Link: https://lore.kernel.org/lkml/20240223171849.10f9901d@booty/
> > > > Fixes: 782bfd03c3ae ("of: property: Improve finding the supplier of a remote-endpoint property")
> > > > Signed-off-by: Saravana Kannan <saravanak@google.com>
> > >
> > > Thanks for your patch!
> > >
> > > > --- a/drivers/of/property.c
> > > > +++ b/drivers/of/property.c
> > > > @@ -1304,7 +1304,7 @@ static struct device_node *parse_remote_endpoint(struct device_node *np,
> > > >                                                  int index)
> > > >  {
> > > >         /* Return NULL for index > 0 to signify end of remote-endpoints. */
> > > > -       if (!index || strcmp(prop_name, "remote-endpoint"))
> > > > +       if (index > 0 || strcmp(prop_name, "remote-endpoint"))
> > > >                 return NULL;
> > > >
> > > >         return of_graph_get_remote_port_parent(np);
> > > > --
> > > > 2.44.0.rc0.258.g7320e95886-goog
> > >
> > > After this, the "Fixed dependency cycle" messages I reported to be
> > > gone in [1] are back.
> > >
> > > In fact, they are slightly different, and there are now even more of them:
> > >
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef7000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef6000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef5000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef4000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef3000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef2000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef1000/ports/port@1/endpoint@0
> > > -platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef0000/ports/port@1/endpoint@0
> > > -platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef3000/ports/port@1/endpoint@2
> > > -platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef2000/ports/port@1/endpoint@2
> > > -platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef1000/ports/port@1/endpoint@2
> > > -platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/video@e6ef0000/ports/port@1/endpoint@2
> > > -platform fead0000.hdmi: Fixed dependency cycle(s) with
> > > /soc/sound@ec500000/ports/port@1/endpoint
> > > -platform feae0000.hdmi: Fixed dependency cycle(s) with
> > > /soc/sound@ec500000/ports/port@2/endpoint
> > > -platform feb00000.display: Fixed dependency cycle(s) with
> > > /soc/hdmi@feae0000/ports/port@0/endpoint
> > > -platform feb00000.display: Fixed dependency cycle(s) with
> > > /soc/hdmi@fead0000/ports/port@0/endpoint
> > > -platform hdmi0-out: Fixed dependency cycle(s) with
> > > /soc/hdmi@fead0000/ports/port@1/endpoint
> > > -platform hdmi1-out: Fixed dependency cycle(s) with
> > > /soc/hdmi@feae0000/ports/port@1/endpoint
> > > -platform vga-encoder: Fixed dependency cycle(s) with /vga/port/endpoint
> > > -platform vga-encoder: Fixed dependency cycle(s) with
> > > /soc/display@feb00000/ports/port@0/endpoint
> > > +platform e6ef0000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef0000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef1000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef1000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef2000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef2000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef3000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef3000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef4000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef5000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef6000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef7000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform ec500000.sound: Fixed dependency cycle(s) with /soc/hdmi@feae0000
> > > +platform ec500000.sound: Fixed dependency cycle(s) with /soc/hdmi@fead0000
> > > +platform ec500000.sound: Fixed dependency cycle(s) with
> > > /soc/i2c@e6510000/codec@10
> > > +platform e6ef7000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef6000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef5000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef4000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef3000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef2000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef1000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform e6ef0000.video: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef7000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef6000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef5000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef4000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef3000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef2000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef1000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef0000
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +platform e6ef3000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef2000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef1000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform e6ef0000.video: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef3000
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef2000
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef1000
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with /soc/video@e6ef0000
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +platform ec500000.sound: Fixed dependency cycle(s) with /soc/hdmi@fead0000
> > > +platform fead0000.hdmi: Fixed dependency cycle(s) with /soc/sound@ec500000
> > > +platform fead0000.hdmi: Fixed dependency cycle(s) with /soc/display@feb00000
> > > +platform ec500000.sound: Fixed dependency cycle(s) with /soc/hdmi@feae0000
> > > +platform feae0000.hdmi: Fixed dependency cycle(s) with /soc/sound@ec500000
> > > +platform feae0000.hdmi: Fixed dependency cycle(s) with /soc/display@feb00000
> > > +platform feae0000.hdmi: Fixed dependency cycle(s) with /soc/display@feb00000
> > > +platform fead0000.hdmi: Fixed dependency cycle(s) with /soc/display@feb00000
> > > +platform feb00000.display: Fixed dependency cycle(s) with /soc/hdmi@feae0000
> > > +platform feb00000.display: Fixed dependency cycle(s) with /soc/hdmi@fead0000
> > > +platform cvbs-in: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +platform hdmi-in: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +platform fead0000.hdmi: Fixed dependency cycle(s) with /hdmi0-out
> > > +platform hdmi0-out: Fixed dependency cycle(s) with /soc/hdmi@fead0000
> > > +platform feae0000.hdmi: Fixed dependency cycle(s) with /hdmi1-out
> > > +platform hdmi1-out: Fixed dependency cycle(s) with /soc/hdmi@feae0000
> > > +platform vga: Fixed dependency cycle(s) with /vga-encoder
> > > +platform feb00000.display: Fixed dependency cycle(s) with /vga-encoder
> > > +platform vga-encoder: Fixed dependency cycle(s) with /vga
> > > +platform vga-encoder: Fixed dependency cycle(s) with /soc/display@feb00000
> > >
> > > -i2c 2-0010: Fixed dependency cycle(s) with
> > > /soc/sound@ec500000/ports/port@0/endpoint
> > > +platform ec500000.sound: Fixed dependency cycle(s) with
> > > /soc/i2c@e6510000/codec@10
> > >
> > > -i2c 4-0070: Fixed dependency cycle(s) with
> > > /soc/csi2@fea80000/ports/port@0/endpoint
> > > -i2c 4-0070: Fixed dependency cycle(s) with
> > > /soc/csi2@feaa0000/ports/port@0/endpoint
> > > -i2c 4-0070: Fixed dependency cycle(s) with /hdmi-in/port/endpoint
> > > -i2c 4-0070: Fixed dependency cycle(s) with /cvbs-in/port/endpoint
> > > +platform feaa0000.csi2: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +platform fea80000.csi2: Fixed dependency cycle(s) with
> > > /soc/i2c@e66d8000/video-receiver@70
> > > +i2c 4-0070: Fixed dependency cycle(s) with /soc/csi2@fea80000
> > > +i2c 4-0070: Fixed dependency cycle(s) with /soc/csi2@feaa0000
> > >
> > > I guess all of that is expected?
> >
> > Hi Geert,
> >
> > Greg has picked up my "post-init-providers" series in his driver core.
>
> You mean https://lore.kernel.org/all/20240305050458.1400667-2-saravanak@google.com/?

Yes.

>
> > Once you pull that in, you should be able to use the
> > post-init-providers property to break these cycles. Basically treat it
> > like any other supplier binding, but use it to mark the link in the
> > cycle that's not real. For the remote-endpoints case, you need to list
> > property at the device level. Not the endpoint, port or ports nodes.
> >
> > Once you add this property, you should see an increase in the number
> > of device links that are present after all device probing is done.
> > Also, a bunch of existing device links should get converted from
> > sync_state_only device links to normal managed device links. Meaning,
> > the sync_state_only file under those /class/devlink/<device-link-x>/
> > folder should change from "1" to "0".
> >
> > If that's what you see and it works, then go ahead and send out a
> > patch so that the boards you care about have a more
> > deterministic/stable probe/suspend/resume ordering.
>
> You mean we have to add additional properties to the DTS?

Yes.

> What about compatibility with old DTBs?

It'll continue working like today.

> Where are the DT bindings for "post-init-providers"?
> I see it was part of earlier submissions, but I cannot find any evidence
> they have ever been accepted by the DT maintainers?

It's been submitted to dt-schema. Rob is okay with it. So it'll land.

You don't need to merge your patches till it lands. But it'll be good
to test it for your case and confirm it makes things better for you.

-Saravana

>
> Thanks!
>
> Gr{oetje,eeting}s,
>
>                         Geert
>
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
>
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds

  reply	other threads:[~2024-03-15  5:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24  5:24 [PATCH] of: property: fw_devlink: Fix stupid bug in remote-endpoint parsing Saravana Kannan
2024-02-24  5:28 ` Saravana Kannan
2024-02-26 12:04   ` Luca Ceresoli
2024-02-29  0:20   ` Rob Herring
2024-02-26  8:19 ` Luca Ceresoli
2024-02-26  8:56 ` Herve Codina
2024-02-29 10:11 ` Geert Uytterhoeven
2024-02-29 22:45   ` Saravana Kannan
2024-02-29 22:47     ` Saravana Kannan
2024-03-14  1:48   ` Saravana Kannan
2024-03-14  8:46     ` Geert Uytterhoeven
2024-03-15  5:50       ` Saravana Kannan [this message]
2024-03-01 21:28 ` Rob Herring
2024-03-21  6:04 ` John Watts
2024-03-23  1:53   ` Saravana Kannan
2024-03-23 12:19     ` John Watts
2024-03-25 22:49       ` Saravana Kannan
2024-03-26  0:42         ` John Watts
2024-03-26  1:35           ` Saravana Kannan
2024-03-26  1:42             ` John Watts
2024-03-26  2:31             ` John Watts

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='CAGETcx9nohVEisxoBDB7Q6eVUv3mx7W50g-Ujx+L-iN=hcKGrw@mail.gmail.com' \
    --to=saravanak@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=geert@linux-m68k.org \
    --cc=herve.codina@bootlin.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh+dt@kernel.org \
    --cc=robh@kernel.org \
    /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.