Re: [PATCH] iio: imu: bmi270: fix zero timestamp in triggered buffer

From: Andy Shevchenko

Date: Thu Oct 29 2026 - 09:19:17 EST


On Wed, Oct 28, 2026 at 10:24:11PM +0800, Liu Yufei wrote:
> On Wed, Oct 28, 2026 at 10:58:25AM +0200, Andy Shevchenko wrote:
> > On Wed, Oct 28, 2026 at 10:59:26AM +0800, Liu Yufei wrote:

...

> > > + s64 timestamp = iio_get_time_ns(indio_dev);
> >
> > Do we need this variable? Why not call it directly?
>
> The intent was to capture the timestamp before the bus read, so it is
> as close as possible to the data ready event rather than after the
> regmap_bulk_read() over I2C/SPI.
>
> If that difference is not considered significant here, I'm happy to
> call it directly in v2.

But the time of the event in the kernel should be ideally with data we get,
not in the past, right?

Jonathan, what our expectations / requirements on the timestamp capture?

--
With Best Regards,
Andy Shevchenko