Re: [PATCH v5 2/4] iio: imu: st_lsm6dsx: Set buffer sampling frequency for accelerometer only

From: Jonathan Cameron

Date: Sat Feb 14 2026 - 10:10:40 EST


On Mon, 09 Feb 2026 09:02:43 +0100
Francesco Lavra <flavra@xxxxxxxxxxxx> wrote:

> On Thu, 2026-01-22 at 17:23 +0100, Francesco Lavra wrote:
> > The st_lsm6dsx_hwfifo_odr_store() function, which is called when
> > userspace
> > writes the buffer sampling frequency sysfs attribute, calls
> > st_lsm6dsx_check_odr(), which accesses the odr_table array at index
> > `sensor->id`; since this array is only 2 entries long, an access for any
> > sensor type other than accelerometer or gyroscope is an out-of-bounds
> > access.
> >
> > The motivation for being able to set a buffer frequency different from
> > the
> > sensor sampling frequency is to support use cases that need accurate
> > event
> > detection (which requires a high sampling frequency) while retrieving
> > sensor data at low frequency. Since all the supported event types are
> > generated from acceleration data only, do not create the buffer sampling
> > frequency attribute for sensor types other than the accelerometer.
> >
> > Fixes: 6b648a36c200 ("iio: imu: st_lsm6dsx: Decouple sensor ODR from FIFO
> > batch data rate")
>
> This patch didn't make it to 6.19. Would it still be OK to merge this in
> the next release cycle? It technically changes userspace, but I think this
> change can be put in the "no one will notice" category.
>

I think it should be fine in 7.0 (though I've been wrong before!)

Thanks,

Jonathan