linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Peter Chen <peter.chen@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>
Subject: Re: ChipIdea USB regression
Date: Tue, 18 Jan 2022 08:39:55 -0600	[thread overview]
Message-ID: <CAL_Jsq+x-q_xOctCCVmzNSwGbWa_uipJ84xa1NCZnjhWSn1vVg@mail.gmail.com> (raw)
In-Reply-To: <20220117095559.GN18506@ediswmail.ad.cirrus.com>

On Mon, Jan 17, 2022 at 3:56 AM Charles Keepax
<ckeepax@opensource.cirrus.com> wrote:
>
> On Mon, Jan 17, 2022 at 09:26:56AM +0000, Charles Keepax wrote:
> > On Sat, Jan 15, 2022 at 09:55:23AM -0600, Rob Herring wrote:
> > > On Fri, Jan 14, 2022 at 5:18 AM Charles Keepax
> > > <ckeepax@opensource.cirrus.com> wrote:
> > > > On Fri, Jan 14, 2022 at 10:56:20AM +0000, Charles Keepax wrote:
> > > > So when that patch copies the DT node to the new platform device
> > > > in ci_hdrc_add_device it copies the compatible stuff as well as
> > > > the IRQ stuff it was targeting, this presumably causes the kernel
> > > > to bind a new copy of the driver to that new device, which probes
> > > > and calls ci_hdrc_add_device again repeating the process until
> > > > it dies.
> > > >
> > > > Kinda looks to me like the best solution might just be to revert
> > > > the patch, I am not sure I see how that copy of the DT is supposed
> > > > to work?
> > >
> > > It's not copying the DT, but yes AFAICT it does match and bind the
> > > child device on the parent driver using the compatible match instead
> > > of matching on driver name. I think we can use the of_reuse_node flag
> > > to avoid this in the match, but that needs some more investigation.
> >
> > Assuming you mean the of_node_reused flag, looks like it already
> > being set, your code does this:
> >
> > @@ -864,6 +864,7 @@ struct platform_device *ci_hdrc_add_device(struct device *dev,
> >       pdev->dev.parent = dev;
> >       + device_set_of_node_from_dev(&pdev->dev, dev);
> >
> > And that function does this:
> >
> > void device_set_of_node_from_dev(struct device *dev, const struct device *dev2)
> > {
> >       of_node_put(dev->of_node);
> >       dev->of_node = of_node_get(dev2->of_node);
> >       dev->of_node_reused = true;
> > }
> > EXPORT_SYMBOL_GPL(device_set_of_node_from_dev);
> >
> > I guess maybe that flag doesn't do what it is supposed to for
> > some reason?
> >
>
> Ah ok it seems that flag is only currently used by the pinctrl
> subsystem, didn't realise that was quite so new and not used
> anywhere. I guess we probably need to add something to the
> platform device code to use that flag too, if that is the way we
> want to run with this.

I pushed a patch[1] for kernel-ci to test if you want to give it a try, too.

Rob

[1] https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/log/?h=for-kernelci

  reply	other threads:[~2022-01-18 14:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 10:56 ChipIdea USB regression Charles Keepax
2022-01-14 11:18 ` Charles Keepax
2022-01-15 15:55   ` Rob Herring
2022-01-17  9:26     ` Charles Keepax
2022-01-17  9:55       ` Charles Keepax
2022-01-18 14:39         ` Rob Herring [this message]
2022-01-18 16:16           ` Charles Keepax
2022-01-16 10:21 ` Thorsten Leemhuis
2022-01-18 16:53   ` Rob Herring
2022-01-18 17:33     ` Thorsten Leemhuis
2022-01-18 18:37       ` Rob Herring

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=CAL_Jsq+x-q_xOctCCVmzNSwGbWa_uipJ84xa1NCZnjhWSn1vVg@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=arnd@arndb.de \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@kernel.org \
    --cc=tony@atomide.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).