* [PATCH] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
@ 2026-10-16 9:28 Jean-Baptiste Maneyrol via B4 Relay
2026-10-16 10:19 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: Jean-Baptiste Maneyrol via B4 Relay @ 2026-10-16 9:28 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko
Cc: Jonathan Cameron, linux-iio, linux-kernel, stable,
Jean-Baptiste Maneyrol
From: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
For getting all odr change events, we need to parse all FIFO frames
in each iio device. Fix this correctly by sending effectively all
frames to all iio devices.
Previously only batches of frames containing a matching sensor event
were sent to the corresponding iio device.
Fixes: f670d4d34773 ("iio: imu: inv_icm42600: fix odr change not caught in certain cases")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
---
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c | 24 +++++++++++-----------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
index 2bf9fc29d7d2..f25ddb23975f 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
@@ -532,20 +532,20 @@ int inv_icm42600_buffer_fifo_parse(struct inv_icm42600_state *st)
ts = &gyro_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_gyro,
st->timestamp.gyro);
- ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
+ if (ret)
+ return ret;
/* handle accelerometer timestamp and FIFO data parsing */
if (st->fifo.nb.accel > 0) {
ts = &accel_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_accel,
st->timestamp.accel);
- ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
+ if (ret)
+ return ret;
return 0;
}
@@ -572,18 +572,18 @@ int inv_icm42600_buffer_hwfifo_flush(struct inv_icm42600_state *st,
if (st->fifo.nb.gyro > 0) {
ts = &gyro_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.gyro, gyro_ts);
- ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
+ if (ret)
+ return ret;
if (st->fifo.nb.accel > 0) {
ts = &accel_st->ts;
inv_sensors_timestamp_interrupt(ts, st->fifo.nb.accel, accel_ts);
- ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
- if (ret)
- return ret;
}
+ ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
+ if (ret)
+ return ret;
return 0;
}
---
base-commit: a22dc7ebb21a6bd4c8b63bc2c1dd46a24945aae7
change-id: 20261016-iio-imu-inv-icm42600-fix-odr-change-event-in-all-frames-74a91cb28a2b
Best regards,
--
Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change
2026-10-16 9:28 [PATCH] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Jean-Baptiste Maneyrol via B4 Relay
@ 2026-10-16 10:19 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-10-16 10:19 UTC (permalink / raw)
To: jean-baptiste.maneyrol
Cc: Jonathan Cameron, David Lechner, Nuno Sá,
Andy Shevchenko, Jonathan Cameron, linux-iio, linux-kernel,
stable
On Fri, Oct 16, 2026 at 11:28:10AM +0200, Jean-Baptiste Maneyrol via B4 Relay wrote:
> For getting all odr change events, we need to parse all FIFO frames
> in each iio device. Fix this correctly by sending effectively all
> frames to all iio devices.
>
> Previously only batches of frames containing a matching sensor event
> were sent to the corresponding iio device.
...
> - ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
> - if (ret)
> - return ret;
> }
+ Blank line.
> + ret = inv_icm42600_gyro_parse_fifo(st->indio_gyro);
> + if (ret)
> + return ret;
>
> /* handle accelerometer timestamp and FIFO data parsing */
> if (st->fifo.nb.accel > 0) {
> ts = &accel_st->ts;
> inv_sensors_timestamp_interrupt(ts, st->fifo.watermark.eff_accel,
> st->timestamp.accel);
> - ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
> - if (ret)
> - return ret;
> }
+ blank line.
> + ret = inv_icm42600_accel_parse_fifo(st->indio_accel);
> + if (ret)
> + return ret;
>
> return 0;
> }
return inv_icm42600_accel_parse_fifo(st->indio_accel);
?
...
Similar comments to the inv_icm42600_buffer_hwfifo_flush() changes.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-16 10:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-16 9:28 [PATCH] iio: imu: inv_icm42600: fix parsing of all FIFO frames for odr change Jean-Baptiste Maneyrol via B4 Relay
2026-10-16 10:19 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®