Re: [PATCH 0/3] driver core: swnode: fix release with shared primary fwnode

From: Andy Shevchenko

Date: Thu Dec 03 2026 - 06:35:21 EST


On Wed, Dec 02, 2026 at 05:34:48PM -0800, Dmitry Torokhov wrote:

...

> This series is intentionally kept minimal for stable backporting.
> Storing the secondary pointer directly on the shared struct
> fwnode_handle still leaves broader limitations unaddressed:
> set_primary_fwnode() only detects direct parent sharing (not grandparent
> or sibling sharing), parent and child or sibling devices sharing a
> primary node still contend for a single secondary slot, and cross-device
> lookups of fwnode->secondary are not synchronized against concurrent
> removal. A separate follow-up (such as an immutable composite
> fwnode_handle) would be needed to address those cleanly.

Yeah, shared fwnodes is PITA. The proper solution is to have a proper list of
the fwnodes (and not just primary + secondary) and have another list of shared
devices. With that the tracking is a matter of atomic add and delete a device
from the respective list.

Thanks for the series, I have looked into the series (not carefully into the
test cases but I always welcome them),
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

--
With Best Regards,
Andy Shevchenko