Re: [PATCH] soundwire: fail slave probe if IRQ cleanup cannot be registered

From: Charles Keepax

Date: Mon Nov 30 2026 - 10:51:35 EST


On Mon, Nov 30, 2026 at 11:18:42AM +0100, Pierre-Louis Bossart wrote:
> On 11/29/26 13:48, Jiawen Liu wrote:
> > sdw_irq_create_mapping() publishes the new virtual IRQ in slave->irq
> > before registering its devres cleanup action. If action registration
> > fails, the reset helper disposes the mapping but the cached IRQ remains
> > nonzero, so the peripheral driver probe receives an invalid IRQ number.
> >
> > Keep the mapping local until cleanup registration succeeds, clear the
> > cached IRQ when the mapping is disposed, and return registration failures
> > to the bus probe path before invoking the peripheral driver.
> >
> > Fixes: a5fef9baa87f ("soundwire: bus: Move irq mapping cleanup into devres")
> > Signed-off-by: Jiawen Liu <1298662399@xxxxxx>
>
> The changes look ok to me, so here's a
>
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxx>
>
> The only problem is that there was already a similar submission in "[RFC
> PATCH] soundwire: protect the slave IRQ mapping during alert dispatch",
> with additional locking suggested but no answer provided to my feedback.
> Adding the initial contributor and Charles in the To: list, not sure all
> the interrupt handling problems are solved.

Yeah not really convinced the locking was necessary in the RFC
one, was waiting on the response to your questions too.

> > + ret = devm_add_action(&slave->dev, sdw_irq_dispose_mapping, slave);
> > + if (ret) {
> > + irq_dispose_mapping(irq);

You don't need to free here, add_action calls the dispose if it
fails. But apart from that I think this looks ok.

Thanks,
Charles