Re: [PATCH v2] iio: pressure: rohm-bm1390: notify trigger on all error paths

From: Andy Shevchenko

Date: Mon May 18 2026 - 06:53:53 EST


On Mon, May 18, 2026 at 02:42:38PM +0500, Stepan Ionichev wrote:
> bm1390_trigger_handler() returns from three error paths without
> calling iio_trigger_notify_done(). The success path at the end
> does, so on a single transient regmap or read failure the trigger
> use_count is never decremented, and the !atomic_read(&trig->use_count)
> guard in iio_trigger_poll_chained() drops every subsequent dispatch.
> The buffered-data flow stays wedged until the trigger is detached.
>
> Funnel all returns through a single done label that calls
> iio_trigger_notify_done() and reports the outcome via IRQ_RETVAL().

...

> +done:
> iio_trigger_notify_done(idev->trig);


Maybe it's better to make this as an implementation and wrap it in something like

handle_trigger_irq()
{
bool result;

// that returns boolean and doesn't have notify call
result = this_old_function(...);

iio_trigger_notify_done(idev->trig);
return IRQ_RETVAL(result);
}


--
With Best Regards,
Andy Shevchenko