From: Jonathan Cameron <jic23@kernel.org>
To: Liu Yufei <lyf98405@gmail.com>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
"Alex Lanzano" <lanzano.alex@gmail.com>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Gustavo Silva" <gustavograzs@gmail.com>,
stable@vger.kernel.org
Subject: Re: [PATCH v3] iio: imu: bmi270: fix zero timestamp in triggered buffer
Date: Sat, 28 Nov 2026 20:20:54 +0000 [thread overview]
Message-ID: <20261128202016.00b12e44@jic23-hlaptop> (raw)
In-Reply-To: <20261124-bmi270-fix-timestamp-v3-1-6356a5467d5a@gmail.com>
On Tue, 24 Nov 2026 17:10:07 +0800
Liu Yufei <lyf98405@gmail.com> wrote:
> The BMI270's own trigger uses iio_trigger_poll_nested() from
> the threaded IRQ handler, bypassing the pollfunc top half.
> This leaves the buffer timestamp at zero or a stale value.
>
> Capture the timestamp in the hard IRQ handler and use it when
> the selected trigger is the BMI270's own trigger. For an
> external trigger, take the timestamp in the threaded buffer
> handler before reading the sensor. Drop the pollfunc top half
> now that the buffer handler always supplies the timestamp.
>
> On an Orange Pi Zero 2W, the original driver produced 256 zero
> timestamps in 256 samples with the BMI270's own trigger.
>
> Fixes: a1854d55f54b ("iio: imu: bmi270: add support for data ready interrupt trigger")
> Cc: stable@vger.kernel.org
> Signed-off-by: Liu Yufei <lyf98405@gmail.com>
So this got a little messy because the driver was updated (by me)
this cycle to use the iio_push_to_buffers_with_ts() helper.
As such I'm going to apply this the slow way and then we can look at backports
as needed. Applied to the testing branch of iio.git with that conflict
resolved.
Longer term, I'm trying to stop drivers using iio_dev->trig directly but
that can just get swept up in that series. Even longer term I want to
spend some time looking at a generic way of dealing with this timestamp
issue but that's a way off given my backlog of things to sort.
Thanks,
Jonathan
prev parent reply other threads:[~2026-11-28 20:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 9:10 Liu Yufei
2026-11-28 20:20 ` Jonathan Cameron [this message]
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=20261128202016.00b12e44@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gustavograzs@gmail.com \
--cc=lanzano.alex@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lyf98405@gmail.com \
--cc=nuno.sa@analog.com \
--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 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®