From: Lorenzo Bianconi <lorenzo@kernel.org>
To: phil.williams@advisoft.co.nz
Cc: "Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Mario Tesi" <martepisa@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] iio: imu: st_lsm6dsx: set ts_sensitivity on parts without freq_fine
Date: Wed, 25 Nov 2026 09:11:57 +0100 [thread overview]
Message-ID: <awaYTa63V-LnP-T-@lore-desk> (raw)
In-Reply-To: <20261125-st-lsm6dsx-ts-fallback-v2-1-ea0ea2512070@advisoft.co.nz>
[-- Attachment #1: Type: text/plain, Size: 3046 bytes --]
> From: Phil Williams <phil.williams@advisoft.co.nz>
>
> 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 <lorenzo@kernel.org>
> Suggested-by: Lorenzo Bianconi <lorenzo@kernel.org>
> Suggested-by: Jonathan Cameron <jic23@kernel.org>
> Signed-off-by: Phil Williams <phil.williams@advisoft.co.nz>
> ---
> 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 <phil.williams@advisoft.co.nz>
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-11-25 8:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 23:15 [PATCH v2] iio: imu: st_lsm6dsx: set ts_sensitivity on parts without freq_fine Phil Williams
2026-11-24 23:15 ` Phil Williams via B4 Relay
2026-11-25 8:11 ` Lorenzo Bianconi [this message]
2026-11-26 2:18 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=awaYTa63V-LnP-T-@lore-desk \
--to=lorenzo@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martepisa@gmail.com \
--cc=nuno.sa@analog.com \
--cc=phil.williams@advisoft.co.nz \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.