All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Jon Nettleton <jon@solid-run.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Subject: Re: [PATCH] software node: balance refcount for managed sw nodes
Date: Tue, 14 Sep 2021 17:13:04 +0300	[thread overview]
Message-ID: <YUCt8KJAGnXdffHx@kuha.fi.intel.com> (raw)
In-Reply-To: <56544211-7407-3de2-e30d-d1dbb7b2aeb2@nxp.com>

On Fri, Sep 10, 2021 at 04:00:49PM +0300, Laurentiu Tudor wrote:
> >> I've spent some time looking into this and it  turns out that in the
> >> ACPI case, device_create_managed_software_node() ends up being called
> >> twice, first here [1] and after that, in the IORT code here [2]. With
> >> the proposed patch this causes software_node_notify(KOBJ_ADD) being
> >> called twice thus triggering the dup sysfs entry warning.
> >> Any comments / ideas welcomed.
> >>
> >> [1] https://elixir.bootlin.com/linux/latest/source/drivers/usb/dwc3/host.c#L111
> > 
> > I think the problem here is that the secondary fwnode get's replaced
> > because the primary fwnode is shared. Can you test it with this, just
> > to see if the problem goes away:
> > 
> > diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
> > index f29a264635aa1..e4b40f8b8f242 100644
> > --- a/drivers/usb/dwc3/host.c
> > +++ b/drivers/usb/dwc3/host.c
> > @@ -76,7 +76,6 @@ int dwc3_host_init(struct dwc3 *dwc)
> >         }
> >  
> >         xhci->dev.parent        = dwc->dev;
> > -       ACPI_COMPANION_SET(&xhci->dev, ACPI_COMPANION(dwc->dev));
> >  
> >         dwc->xhci = xhci;
> 
> 
> Thanks for looking into this! Yes, this does make the issue go away.

We need to think about how to solve this one. The problem is that we
have to share the ACPI node between the parent dwc3 device and child
xHCI, but at the same xHCI needs to have its own software node.

The fwnode->secondary pointer does not quite bend to this. If the
primary fwnode is shared, the secondary fwnode has to be shared as
well.

thanks,

-- 
heikki

  reply	other threads:[~2021-09-14 14:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-16 10:16 [PATCH] software node: balance refcount for managed sw nodes laurentiu.tudor
2021-07-16 10:34 ` Laurentiu Tudor
2021-07-16 12:17 ` Andy Shevchenko
2021-07-16 17:21   ` Jon Nettleton
2021-07-19 12:00     ` Laurentiu Tudor
2021-07-19 12:22       ` Andy Shevchenko
2021-07-20  9:20         ` Laurentiu Tudor
2021-07-20 10:27           ` Andy Shevchenko
2021-07-26  7:59             ` Laurentiu Tudor
2021-09-07 15:59               ` Laurentiu Tudor
2021-09-09 12:13                 ` Heikki Krogerus
2021-09-09 12:16                   ` Heikki Krogerus
2021-09-09 14:01                     ` Laurentiu Tudor
2021-09-10 12:05                       ` Laurentiu Tudor
2021-09-10 12:38                         ` Heikki Krogerus
2021-09-10 13:00                           ` Laurentiu Tudor
2021-09-14 14:13                             ` Heikki Krogerus [this message]
2021-09-14 14:00 ` Heikki Krogerus
2021-09-27 10:22 Laurentiu Tudor
2021-09-27 12:17 ` Greg KH
2021-09-27 12:42   ` Laurentiu Tudor
2021-09-27 13:34     ` Greg KH
2021-09-27 13:36     ` Heikki Krogerus

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=YUCt8KJAGnXdffHx@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jon@solid-run.com \
    --cc=laurentiu.tudor@nxp.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=rafael@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.