summaryrefslogtreecommitdiffstats
path: root/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
diff options
context:
space:
mode:
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>2024-05-29 15:47:17 +0000
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2024-06-02 11:56:40 +0100
commitd7bd473632d07f8a54655c270c0940cc3671c548 (patch)
tree9286b850a08110db7ecdea1fa2b36fc743d37186 /drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
parent95444b9eeb8c5c0330563931d70c61ca3b101548 (diff)
downloadlinux-d7bd473632d07f8a54655c270c0940cc3671c548.tar.gz
linux-d7bd473632d07f8a54655c270c0940cc3671c548.tar.bz2
linux-d7bd473632d07f8a54655c270c0940cc3671c548.zip
iio: imu: inv_icm42600: stabilized timestamp in interrupt
Use IRQF_ONESHOT flag to ensure the timestamp is not updated in the hard handler during the thread handler. And compute and use the effective watermark value that correspond to this first timestamp. This way we can ensure the timestamp is always corresponding to the value used by the timestamping mechanism. Otherwise, it is possible that between FIFO count read and FIFO processing the timestamp is overwritten in the hard handler. Fixes: ec74ae9fd37c ("iio: imu: inv_icm42600: add accurate timestamping") Cc: stable@vger.kernel.org Signed-off-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://lore.kernel.org/r/20240529154717.651863-1-inv.git-commit@tdk.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h')
-rw-r--r--drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
index 8b85ee333bf8..f6c85daf42b0 100644
--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
+++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
@@ -32,6 +32,8 @@ struct inv_icm42600_fifo {
struct {
unsigned int gyro;
unsigned int accel;
+ unsigned int eff_gyro;
+ unsigned int eff_accel;
} watermark;
size_t count;
struct {