From: Johan Hovold <johan@kernel.org>
To: Danilo Krummrich <dakr@kernel.org>
Cc: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Daniel Scally <djrscally@gmail.com>,
Heikki Krogerus <heikki.krogerus@linux.intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Bartosz Golaszewski <brgl@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
linux-acpi@vger.kernel.org, driver-core@lists.linux.dev,
linux-kernel@vger.kernel.org,
Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
Subject: Re: [PATCH] software node: only let the owner release a managed node
Date: Mon, 9 Nov 2026 15:59:19 +0100 [thread overview]
Message-ID: <avHfx80pHRPwtqRt@hovoldconsulting.com> (raw)
In-Reply-To: <DMQREV9DFQST.1Z4ZFOFTS0Z7W@kernel.org>
On Mon, Nov 09, 2026 at 03:45:29PM +0100, Danilo Krummrich wrote:
> On Mon Nov 9, 2026 at 3:34 PM CET, Johan Hovold wrote:
> > On Mon, Nov 09, 2026 at 03:10:31PM +0100, Danilo Krummrich wrote:
> >> On Mon Nov 9, 2026 at 2:37 PM CET, Johan Hovold wrote:
> >> > On Mon, Nov 02, 2026 at 04:25:16PM +0100, Bartosz Golaszewski wrote:
> >> >> device_create_managed_software_node() creates a node whose lifetime is
> >> >> tied to the device it was created for. software_node_notify_remove() is
> >> >> called for every device that has the node as its fwnode (primary OR
> >> >> secondary) and, if the node is managed, unconditionally detaches it from
> >> >> that device and drops the creation reference.
> >> >>
> >> >> This breaks when the node is shared with another device. Example: the
> >> >> i2c-designware copies the parent's fwnode to the adapter's struct device.
> >> >> When the adapter is deleted, it releases the reference that belongs to
> >> >> the owner and the latter ends up with a dangling pointer.
> >> >>
> >> >> Record the device's "manager" and only perform the actual release when
> >> >> notify is called for that "owner" device.
> >> >>
> >> >> Reported-by: Balasubramani Vivekanandan <balasubramani.vivekanandan@intel.com>
> >> >> Closes: https://lore.kernel.org/all/20261009164241.923756-2-balasubramani.vivekanandan@intel.com/
> >> >> Fixes: 151f6ff78cdf ("software node: Provide replacement for device_add_properties()")
> >> Also, are we sure this is -rc material? I think the original commit wasn't
> >> technically broken and the bug in Xe was fixed otherwise.
> >
> > The regression was introduced by 0f485f88656a ("drm/xe/i2c: use
> > device_create_managed_software_node()") in 7.3 and Bartosz framed it as
> > an alternative fix for that bug.
> >
> > Are you saying this has since been fixed differently?
> >
> > If so, this can obviously wait.
>
> There's the fix in [1] and Andy said he'll pick it up for Xe in one of the
> replies.
Yeah, I skimmed the thread now. I think the last thing he said was:
The patch looks fine to me but I still see that there are some
concerns. Like Danilo's points are valid, can those be addressed
later?
...
Let's wait a little and if nothing arises I can apply this for
XE.
and in the reply they say would go back to managed nodes "once the
limitation is addressed".
The proposed xe fix is still not in linux-next however, and this patch
carries a Closes: tag for the regression.
So I think we can just go ahead and fix this in driver core directly.
Johan
> [1] https://lore.kernel.org/all/20261009164241.923756-2-balasubramani.vivekanandan@intel.com/
prev parent reply other threads:[~2026-11-09 14:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 15:25 Bartosz Golaszewski
2026-11-04 6:47 ` Vivekanandan, Balasubramani
2026-11-04 8:19 ` Andy Shevchenko
2026-11-04 8:26 ` Vivekanandan, Balasubramani
2026-11-04 8:35 ` Andy Shevchenko
2026-11-04 8:40 ` Vivekanandan, Balasubramani
2026-11-06 17:47 ` Heikki Krogerus
2026-11-09 13:37 ` Johan Hovold
2026-11-09 14:10 ` Danilo Krummrich
2026-11-09 14:30 ` Bartosz Golaszewski
2026-11-09 14:34 ` Johan Hovold
2026-11-09 14:45 ` Danilo Krummrich
2026-11-09 14:59 ` Johan Hovold [this message]
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=avHfx80pHRPwtqRt@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=balasubramani.vivekanandan@intel.com \
--cc=bartosz.golaszewski@oss.qualcomm.com \
--cc=brgl@kernel.org \
--cc=dakr@kernel.org \
--cc=djrscally@gmail.com \
--cc=driver-core@lists.linux.dev \
--cc=gregkh@linuxfoundation.org \
--cc=heikki.krogerus@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.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
all inboxes | Powered by JetHome®