summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Ionichev <sozdayvek@gmail.com>2026-05-18 21:11:38 +0300
committerJonathan Cameron <jic23@kernel.org>2026-06-03 20:29:09 +0300
commitae696dfa47c30016cd429b9db5e70b259b8f509e (patch)
tree67ef4099032cbe5cb92368e432646be470f0835e
parenteb60a24b35bfb9e85a272e561379833e49a12a79 (diff)
downloadlinux-ae696dfa47c30016cd429b9db5e70b259b8f509e.tar.xz
iio: adc: nxp-sar-adc: harden buffer ISR against per-channel read failure
nxp_sar_adc_isr_buffer() bails on the first channel-read failure without calling iio_trigger_notify_done(), so the trigger use_count is left incremented and iio_trigger_poll_chained() drops subsequent dispatches until the device is rebound. Reaching this path means a state machine has gone wrong (driver bug or the SAR ADC in an unexpected state) rather than a transient bus issue, so this is hardening rather than a bug fix. If the underlying condition persists the device is wedged and needs an unbind anyway. Call iio_trigger_notify_done() on the error exit too, matching the success path. The nxp_sar_adc_read_notify() duplication is intentional and avoids a goto label for a two-line bail-out, as suggested by David. Signed-off-by: Stepan Ionichev <sozdayvek@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
-rw-r--r--drivers/iio/adc/nxp-sar-adc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
index 01f3da56e987..15c7432808f4 100644
--- a/drivers/iio/adc/nxp-sar-adc.c
+++ b/drivers/iio/adc/nxp-sar-adc.c
@@ -346,6 +346,7 @@ static void nxp_sar_adc_isr_buffer(struct iio_dev *indio_dev)
ret = nxp_sar_adc_read_data(info, info->buffered_chan[i]);
if (ret < 0) {
nxp_sar_adc_read_notify(info);
+ iio_trigger_notify_done(indio_dev->trig);
return;
}