FAILED: Patch "iio: accel: adxl380: Avoid reading more entries than present in FIFO" failed to apply to 6.12-stable tree
Subsystems (4)
Sasha Levin
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
Thanks,
Sasha
------------------ original commit in Linus's tree ------------------
From c1b14015224cfcccd5356333763f2f4f401bd810 Mon Sep 17 00:00:00 2001
From: Francesco Lavra <[email protected]>
Date: Mon, 19 Jan 2026 11:23:16 +0100
Subject: [PATCH] iio: accel: adxl380: Avoid reading more entries than present
in FIFO
The interrupt handler reads FIFO entries in batches of N samples, where N is the number of scan elements that have been enabled. However, the sensor fills the FIFO one sample at a time, even when more than one channel is enabled. Therefore,the number of entries reported by the FIFO status registers may not be a multiple of N; if this number is not a multiple, the number of entries read from the FIFO may exceed the number of entries actually present.
To fix the above issue, round down the number of FIFO entries read from the status registers so that it is always a multiple of N.
--- drivers/iio/accel/adxl380.c | 1 + 1 file changed, 1 insertion(+)
drivers/iio/accel/adxl380.c +1 -0
@@ -966,6 +966,7 @@ static irqreturn_t adxl380_irq_handler(int irq, void *p)if (ret)return IRQ_HANDLED ; + fifo_entries =rounddown (fifo_entries, st->fifo_set_size);for (i =0 ; i < fifo_entries; i += st->fifo_set_size) { ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA, &st->fifo_buf[i],
Signature · 1 line
2.51.0