[PATCH v4 4/4] soundwire: intel_auxdevice: Don't disable IRQs before removing children

From: Charles Keepax

Date: Tue Nov 24 2026 - 11:11:46 EST


Currently the auxiliary device for the link disables IRQs before it
calls sdw_bus_master_delete(). This has the side effect that none
of the devices on the link can access their own registers whilst
their remove functions run, because the IRQs are required for bus
transactions to function.

Now that the link auxiliary drivers register their own IRQs and a
core helper is available to destroy the slaves before the master
is destroyed, it is save to update intel_link_remove() to leave
the IRQ enabled whilst the slaves are destroyed.

Signed-off-by: Charles Keepax <ckeepax@xxxxxxxxxxxxxxxxxxxxx>
---

Changes since v3:
- Dropped all the link lock and list stuff and just use the IRQ core.
- Removed Pierre's Reviewed-by as things have changed quite
substantively.

drivers/soundwire/intel_auxdevice.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index d84fbe716febc..450c3927f0910 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -511,8 +511,6 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
struct sdw_intel *sdw = cdns_to_intel(cdns);
struct sdw_bus *bus = &cdns->bus;

- free_irq(sdw->link_res->irq, cdns);
-
/*
* Since pm_runtime is already disabled, we don't decrease
* the refcount when the clock_stop_quirk is
@@ -521,8 +519,15 @@ static void intel_link_remove(struct auxiliary_device *auxdev)
if (!bus->prop.hw_disabled) {
sdw_intel_debugfs_exit(sdw);
cancel_delayed_work_sync(&cdns->attach_dwork);
- sdw_cdns_enable_interrupt(cdns, false);
}
+
+ sdw_bus_slaves_delete(bus);
+
+ free_irq(sdw->link_res->irq, cdns);
+
+ if (!bus->prop.hw_disabled)
+ sdw_cdns_enable_interrupt(cdns, false);
+
sdw_bus_master_delete(bus);
}

--
2.47.3