* [PATCH v2] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
@ 2023-02-18 13:51 Mehdi Djait
2023-02-18 17:30 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Mehdi Djait @ 2023-02-18 13:51 UTC (permalink / raw)
To: mazziesaccount, jic23; +Cc: linux-iio, lars, Mehdi Djait
The trigger_handler gets called from the IRQ thread handler using
iio_trigger_poll_chained() which will only call the bottom half of the
pollfunc and therefore pf->timestamp will not get set.
Use instead the timestamp from the driver's private data which is always
set in the IRQ handler.
Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")
Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com>
---
Changes since v1:
- Add Fixes tag
Relevant discussion: https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f
drivers/iio/accel/kionix-kx022a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
index f866859855cd..1c3a72380fb8 100644
--- a/drivers/iio/accel/kionix-kx022a.c
+++ b/drivers/iio/accel/kionix-kx022a.c
@@ -864,7 +864,7 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
if (ret < 0)
goto err_read;
- iio_push_to_buffers_with_timestamp(idev, data->buffer, pf->timestamp);
+ iio_push_to_buffers_with_timestamp(idev, data->buffer, data->timestamp);
err_read:
iio_trigger_notify_done(idev->trig);
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
2023-02-18 13:51 [PATCH v2] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler Mehdi Djait
@ 2023-02-18 17:30 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-02-18 17:30 UTC (permalink / raw)
To: Mehdi Djait; +Cc: mazziesaccount, linux-iio, lars
On Sat, 18 Feb 2023 14:51:11 +0100
Mehdi Djait <mehdi.djait.k@gmail.com> wrote:
> The trigger_handler gets called from the IRQ thread handler using
> iio_trigger_poll_chained() which will only call the bottom half of the
> pollfunc and therefore pf->timestamp will not get set.
>
> Use instead the timestamp from the driver's private data which is always
> set in the IRQ handler.
>
> Fixes: 7c1d1677b322 ("iio: accel: Support Kionix/ROHM KX022A accelerometer")
> Signed-off-by: Mehdi Djait <mehdi.djait.k@gmail.com>
You should have picked up Matti's Reviewed-by tag from v1.
I've done so whilst applying (I might well not have noticed it if I'd not just
read that thread)
I've also added a Link tag to the below mentioned discussion (first email
with a shorter link.
Applied to the fixes-togreg branch of iio.git and marked for stable inclusion.
Thanks,
Jonathan
> ---
> Changes since v1:
> - Add Fixes tag
>
> Relevant discussion: https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f
>
> drivers/iio/accel/kionix-kx022a.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/accel/kionix-kx022a.c b/drivers/iio/accel/kionix-kx022a.c
> index f866859855cd..1c3a72380fb8 100644
> --- a/drivers/iio/accel/kionix-kx022a.c
> +++ b/drivers/iio/accel/kionix-kx022a.c
> @@ -864,7 +864,7 @@ static irqreturn_t kx022a_trigger_handler(int irq, void *p)
> if (ret < 0)
> goto err_read;
>
> - iio_push_to_buffers_with_timestamp(idev, data->buffer, pf->timestamp);
> + iio_push_to_buffers_with_timestamp(idev, data->buffer, data->timestamp);
> err_read:
> iio_trigger_notify_done(idev->trig);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-02-18 17:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-18 13:51 [PATCH v2] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler Mehdi Djait
2023-02-18 17:30 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox