> From: Phil Williams > > Commit 8abbf45fcda0 ("iio: st_lsm6dsx: Fixed calibrated timestamp > calculation") takes the FIFO timestamp scale from ts_sensitivity. > That field is only filled in for parts that have freq_fine. The > untagged-FIFO parts are left at zero: > > LSM6DS3 > LSM6DS3H > LSM6DSL, LSM6DSM, ISM330DLC and LSM6DS3TR-C > > st_lsm6dsx_read_fifo() multiplies the raw counter by hw->ts_gain, so > every sample is published with the timestamp taken when the buffer > was enabled. The accelerometer and gyroscope values still update. > Userspace that integrates attitude from the timestamp delta treats a > stuck timestamp as dt = 0. > > Set ts_sensitivity to the previous fixed scale of 25000 ns/tick on > those entries. They have no freq_fine register, so ts_trim_coeff is > left unset and no trim is applied. > > Fixes: 8abbf45fcda0 ("iio: st_lsm6dsx: Fixed calibrated timestamp calculation") > Cc: stable@vger.kernel.org Acked-by: Lorenzo Bianconi > Suggested-by: Lorenzo Bianconi > Suggested-by: Jonathan Cameron > Signed-off-by: Phil Williams > --- > Resending inline. The first copy went out as an attachment. > No code changes. > --- > Changes in v2: > - Drop the ts_gain fallback in st_lsm6dsx_init_hw_timer() and set > .ts_sensitivity = 25000 in the LSM6DS3, LSM6DS3H and LSM6DSL settings > entries instead (Lorenzo, Jonathan). > - Leave .ts_trim_coeff unset on those entries since they have no > freq_fine register (Francesco). > - Link to v1: https://lore.kernel.org/r/20261116-st-lsm6dsx-ts-fallback-v1-1-8ace30afbfb5@advisoft.co.nz > --- > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > index 823f8ac66..dffaf76b5 100644 > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > @@ -434,6 +434,7 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { > .addr = 0x09, > .mask = GENMASK(5, 3), > }, > + .ts_sensitivity = 25000, > }, > .event_settings = { > .sources = { > @@ -601,6 +602,7 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { > .addr = 0x09, > .mask = GENMASK(5, 3), > }, > + .ts_sensitivity = 25000, > }, > .event_settings = { > .sources = { > @@ -802,6 +804,7 @@ static const struct st_lsm6dsx_settings st_lsm6dsx_sensor_settings[] = { > .addr = 0x09, > .mask = GENMASK(5, 3), > }, > + .ts_sensitivity = 25000, > }, > .shub_settings = { > .page_mux = { > > --- > base-commit: fa2933aac170dd19c6a7f0d7b81a8f537e40915c > change-id: 20261116-st-lsm6dsx-ts-fallback-cd21f1d1e30e > > Best regards, > -- > Phil Williams > >