Re: [PATCH] mfd: core: Remove software node after unregistering platform device

From: Dmitry Torokhov

Date: Fri Dec 04 2026 - 17:34:25 EST


Hi Cesar,

On Fri, Dec 04, 2026 at 02:29:14PM -0800, Julio Cesar Martinez Cibrian wrote:
> Hi Andy, Dmitry,
>
> Thanks for the guidance. I applied Dmitry's series and tested the
> plain removal reorder in mfd_remove_devices_fn() (without the v1
> shared_fwnode workaround) on top of it on my Intel LPSS /
> i2c-designware system: 10 intel-lpss + 3 i2c_designware unbind/bind
> cycles, plus the platform-device-swnode, property-entry and
> software-node-links KUnit tests. Everything passes cleanly, with no
> sysfs duplicate-filename warnings and no -EBUSY on rebind.
>
> Dmitry, feel free to add to your series:
>
> Tested-by: Cesar Cibrian <cesarcibrian.ai@xxxxxxxxx>
>
> Moving device_remove_software_node() after platform_device_unregister()
> strictly depends on Dmitry's patch 1/3: without it, a shared ACPI
> primary node is left with a dangling fn->secondary, leading to a
> use-after-free on rebind. So the two must not be applied out of order.
>
> How would you prefer to handle it? Dmitry, would you like to carry it
> as 4/4 in your v2? Otherwise I can send it separately with the hard
> dependency stated in the commit message. Lee, do you have a preference
> from the MFD side?

I think it really depends if driver core folks are OK with the series
and how Lee wants to handle this as it would become a cross-subsystem
series then.

Thanks.

--
Dmitry