iio: accel: kionix-kx022a: Timestamp minor fix
Subsystems (2)
cover iio: accel: kionix-kx022a: Timestamp minor fix
As discussed in [1] here is a patch to get the timestamp in the trigger handler from the driver's private data
Mehdi Djait (1):
iio: accel: kionix-kx022a: Get the timestamp from the driver's private
data in the trigger_handler
drivers/iio/accel/kionix-kx022a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.30.2
PATCH 1/1 iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
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.
--- drivers/iio/accel/kionix-kx022a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/kionix-kx022a.c +1 -1
@@ -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);
Signature · 1 line
2.30.2
Re: [PATCH 1/1] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
Quoted 8 lines · Mehdi Djait
The
trigger_handlergets called from the IRQ thread handler usingiio_trigger_poll_chained()which will only call the bottom half of the pollfunc and thereforepf->timestampwill not get set.Use instead the timestamp from the driver's private data which is always set in the IRQ handler.
Signed-off-by Mehdi Djait <[email protected]>
Quoted 17 lines
--- drivers/iio/accel/kionix-kx022a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/accel/kionix-kx022a.c +1
-1@@ -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);
Signature · 5 lines
Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~
Matti Vaittinen
maintainerRe: [PATCH 1/1] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
Quoted 5 lines · Matti Vaittinen
Quoted 4 lines · Mehdi Djait
The
trigger_handlergets called from the IRQ thread handler usingiio_trigger_poll_chained()which will only call the bottom half of the pollfunc and thereforepf->timestampwill not get set.
Quoted 7 lines
Quoted 4 lines
Use instead the timestamp from the driver's private data which is always set in the IRQ handler.
Signed-off-by Mehdi Djait <[email protected]>Reviewed-by Matti Vaittinen <[email protected]>
Oh. I just noticed there is no Fixes tag. It'd be good to have one as it usually helps fixes like this being back-ported to stable.
Quoted 19 lines
Quoted 18 lines
---
drivers/iio/accel/kionix-kx022a.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/accel/kionix-kx022a.c +1
-1@@ -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);
Signature · 5 lines
Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~
Re: [PATCH 1/1] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler
Hi Matti,
Quoted 9 lines · Matti Vaittinen
Quoted 8 lines · Matti Vaittinen
Quoted 7 lines · Mehdi Djait
The
trigger_handlergets called from the IRQ thread handler usingiio_trigger_poll_chained()which will only call the bottom half of the pollfunc and thereforepf->timestampwill not get set.Use instead the timestamp from the driver's private data which is always set in the IRQ handler.
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
Signed-off-by Mehdi Djait <[email protected]>Reviewed-by Matti Vaittinen <[email protected]>Oh. I just noticed there is no Fixes tag. It'd be good to have one as it usually helps fixes like this being back-ported to stable.
I will add the Fixes tag and send the patch again.
--
Kind Regards
Mehdi Djait
Matti Vaittinen
maintainerThanks again Mehdi. It's great to have this fixed :)
Quoted 5 lines · Mehdi Djait
As discussed in [1] here is a patch to get the timestamp in the trigger handler from the driver's private data
By the way, I don't think a cover-letter is required for single patches. You can usually put the relevant information in the commit message. Additionally, if there is some questions, suggestions or other relevant bits you wish to say - but don't want to include in commit logs - you can usually place them in the patch mail directly after the first "---"
Eg:
<commit message>
<Signed-off-by and other tags>
---
Here we can add a note / request if required.
drivers/iio/accel/kionix-kx022a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/accel/kionix-kx022a.c +0 -0
Quoted 7 lines
Mehdi Djait (1):
iio: accel: kionix-kx022a: Get the timestamp from the driver's private
data in thetrigger_handlerdrivers/iio/accel/kionix-kx022a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 5 lines
Matti Vaittinen Linux kernel developer at ROHM Semiconductors Oulu Finland ~~ When things go utterly wrong vim users can always type :help! ~~
Hi Matti,
Quoted 16 lines · Matti Vaittinen
Thanks again Mehdi. It's great to have this fixed :)
Quoted 5 lines · Mehdi Djait
As discussed in [1] here is a patch to get the timestamp in the trigger handler from the driver's private data
By the way, I don't think a cover-letter is required for single patches. You can usually put the relevant information in the commit message. Additionally, if there is some questions, suggestions or other relevant bits you wish to say - but don't want to include in commit logs - you can usually place them in the patch mail directly after the first
"---"
Quoted 9 lines
Eg:
<commit message>
<Signed-off-by and other tags>---
Here we can add a note / request if required.
Yes, that's why I sent a cover-letter, I wanted to include relevant bits but not in the commit message (a reference to the discussion).
I should have sent the patch --in-reply-to the thread with the discussion anyway.
Thank you for the help :)
--
Kind Regards
Mehdi Djait
Jonathan Cameron
maintainerQuoted 26 lines · On Sat, 18 Feb 2023 14:32:46 +0100 Mehdi Djait <[email protected]> wrote:
Hi Matti,
Quoted 23 lines · Matti Vaittinen
Thanks again Mehdi. It's great to have this fixed :)
Quoted 5 lines · Mehdi Djait
As discussed in [1] here is a patch to get the timestamp in the trigger handler from the driver's private data
By the way, I don't think a cover-letter is required for single patches. You can usually put the relevant information in the commit message. Additionally, if there is some questions, suggestions or other relevant bits you wish to say - but don't want to include in commit logs - you can usually place them in the patch mail directly after the first
"---"Eg:
<commit message>
<Signed-off-by and other tags>---
Quoted 8 lines
Quoted 2 lines
Here we can add a note / request if required.
Yes, that's why I sent a cover-letter, I wanted to include relevant bits but not in the commit message (a reference to the discussion).
I should have sent the patch --in-reply-to the thread with the discussion anyway.
Don't do that. Use a Link tag to the discussion instead. Otherwise the patch series can get buried and lost.
Quoted 6 lines
Thank you for the help :)
--
Kind Regards
Mehdi Djait