From: Richard Fitzgerald [ Upstream commit ee1811eacdbba15a374957c2bcc6ba7102e2b781 ] Call sdw_irq_create_mapping() before calling the peripheral driver probe() so that it is possible to request the IRQ during probe(). Previously creation of the mapping was conditional on the use_domain_irq flag in the driver properties. But these are filled in after probe(), which meant it wasn't possible to request the IRQ during probe(). This was ok for MFD drivers where only children requested the IRQ. But for normal drivers it led to the non-standard behavior of having to defer requesting the IRQ until after probe(). CC: stable@vger.kernel.org # 7.2 Signed-off-by: Richard Fitzgerald Acked-by: Vinod Koul Link: https://patch.msgid.link/20260810104045.60701-4-rf@opensource.cirrus.com Signed-off-by: Mark Brown Signed-off-by: Charles Keepax --- Backporting this to fix a race in the SDCA class driver. The SDCA class driver probe kicks off a work item that will request the SDCA IRQ, as the code here registered the IRQ after the call to probe, there is a race resulting in the SDCA class driver not getting its IRQ if the work runs before the core call to sdw_irq_create_mapping(). This seems to be showing up on a few laptops on 7.2 so would be really nice to get this into stable to stem those reports a little. Thanks, Charles drivers/soundwire/bus_type.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index e73c1bea90593..d61a97c5b41ef 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -105,6 +105,9 @@ static int sdw_bus_probe(struct device *dev) } slave->index = ret; + /* Create IRQ mapping now so the driver can get it in probe() */ + sdw_irq_create_mapping(slave); + ret = drv->probe(slave, id); if (ret) { ida_free(&slave->bus->slave_ida, slave->index); @@ -117,9 +120,6 @@ static int sdw_bus_probe(struct device *dev) if (drv->ops && drv->ops->read_prop) drv->ops->read_prop(slave); - if (slave->prop.use_domain_irq) - sdw_irq_create_mapping(slave); - /* init the dynamic sysfs attributes we need */ ret = sdw_slave_sysfs_dpn_init(slave); if (ret < 0) -- 2.47.3