]> www.infradead.org Git - users/jedix/linux-maple.git/commit
iio: imu: inv_icm42600: stabilized timestamp in interrupt
authorJean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
Wed, 29 May 2024 15:47:17 +0000 (15:47 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 2 Jun 2024 10:56:40 +0000 (11:56 +0100)
commitd7bd473632d07f8a54655c270c0940cc3671c548
tree9286b850a08110db7ecdea1fa2b36fc743d37186
parent95444b9eeb8c5c0330563931d70c61ca3b101548
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>
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.h
drivers/iio/imu/inv_icm42600/inv_icm42600_core.c