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

From: Andy Shevchenko

Date: Sat Dec 05 2026 - 06:00:38 EST


On Fri, Dec 04, 2026 at 02:29:14PM -0800, Julio Cesar Martinez Cibrian wrote:
>
> 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.

Good news, thanks for doing that!

>
> Dmitry, feel free to add to your series:
>
> Tested-by: Cesar Cibrian <cesarcibrian.ai@xxxxxxxxx>

Taking into account the process, can you reply to that thread, so the existing
tools will pick up the tag automatically?

> 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?

As Dmitry already answered, we are all depend on the respective maintainers.

--
With Best Regards,
Andy Shevchenko