Skip to content

Commit fd15594

Browse files
charleskeepaxvinodkoul
authored andcommitted
soundwire: bus: Fix race on the creation of the IRQ domain
The SoundWire IRQ domain needs to be created before any slaves are added to the bus, such that the domain is always available when needed. Move the call to sdw_irq_create() before the calls to sdw_acpi_find_slaves() and sdw_of_find_slaves(). Fixes: 12a9512 ("soundwire: bus: Allow SoundWire peripherals to register IRQ handlers") Signed-off-by: Charles Keepax <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 0af2f6b commit fd15594

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/soundwire/bus.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
122122
set_bit(SDW_GROUP13_DEV_NUM, bus->assigned);
123123
set_bit(SDW_MASTER_DEV_NUM, bus->assigned);
124124

125+
ret = sdw_irq_create(bus, fwnode);
126+
if (ret)
127+
return ret;
128+
125129
/*
126130
* SDW is an enumerable bus, but devices can be powered off. So,
127131
* they won't be able to report as present.
@@ -138,6 +142,7 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
138142

139143
if (ret < 0) {
140144
dev_err(bus->dev, "Finding slaves failed:%d\n", ret);
145+
sdw_irq_delete(bus);
141146
return ret;
142147
}
143148

@@ -156,10 +161,6 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
156161
bus->params.curr_bank = SDW_BANK0;
157162
bus->params.next_bank = SDW_BANK1;
158163

159-
ret = sdw_irq_create(bus, fwnode);
160-
if (ret)
161-
return ret;
162-
163164
return 0;
164165
}
165166
EXPORT_SYMBOL(sdw_bus_master_add);

0 commit comments

Comments
 (0)