Re: [PATCH v3] iio: pressure: rohm-bm1390: harden trigger handler against transient errors
From: Jonathan Cameron
Date: Fri Jul 03 2026 - 19:00:36 EST
On Tue, 19 May 2026 09:19:55 +0300
Matti Vaittinen <mazziesaccount@xxxxxxxxx> wrote:
> On 18/05/2026 21:11, 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
> > transient regmap or read failure the trigger's use_count is never
> > decremented and iio_trigger_poll_chained() drops subsequent dispatches
> > until the trigger is reattached.
> >
> > This is not a fix for a reported bug, only hardening against hardware
> > or bus glitches; if a glitch is persistent the device is wedged and
> > needs an unbind anyway, which is left to the user.
> >
> > Split the function so the inner helper returns bool with the data-read
> > outcome, and the outer IRQ handler calls iio_trigger_notify_done()
> > once and reports the result via IRQ_RETVAL().
> >
> > Signed-off-by: Stepan Ionichev <sozdayvek@xxxxxxxxx>
>
> Reviewed-by: Matti Vaittinen <mazziesaccount@xxxxxxxxx>
>
Applied to the testing branch of iio.git.
Thanks
Jonathan