Skip to content

Commit

Permalink
soundwire: bus: Fix race on the creation of the IRQ domain
Browse files Browse the repository at this point in the history
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 <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250409122239.1396489-1-ckeepax@opensource.cirrus.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Charles Keepax authored and Vinod Koul committed Apr 10, 2025
1 parent 0af2f6b commit fd15594
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/soundwire/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,
set_bit(SDW_GROUP13_DEV_NUM, bus->assigned);
set_bit(SDW_MASTER_DEV_NUM, bus->assigned);

ret = sdw_irq_create(bus, fwnode);
if (ret)
return ret;

/*
* SDW is an enumerable bus, but devices can be powered off. So,
* they won't be able to report as present.
Expand All @@ -138,6 +142,7 @@ int sdw_bus_master_add(struct sdw_bus *bus, struct device *parent,

if (ret < 0) {
dev_err(bus->dev, "Finding slaves failed:%d\n", ret);
sdw_irq_delete(bus);
return ret;
}

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

ret = sdw_irq_create(bus, fwnode);
if (ret)
return ret;

return 0;
}
EXPORT_SYMBOL(sdw_bus_master_add);
Expand Down

0 comments on commit fd15594

Please sign in to comment.