Skip to contentSkip to conversation

iio: accel: kionix-kx022a: Timestamp minor fix

PATCH Superseded Mehdi Djait 3 participants 8 messages Feb 17, 2023 – Feb 18, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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

[1] https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f

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
#1 lore raw

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
index f866859855cd..1c3a72380fb8 100644
@@ -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
maintainer Reviewed-by on v1 1/1
#2 lore raw

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_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.

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
index f866859855cd..1c3a72380fb8 100644
@@ -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! ~~
maintainer
#3 lore raw

Re: [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_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.

Quoted 7 lines
Quoted 4 lines

Use instead the timestamp from the driver's private data which is always set in the IRQ handler.

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
index f866859855cd..1c3a72380fb8 100644
@@ -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! ~~
maintainer
#5 lore raw
In reply to Mehdi Djait

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

[1] https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f

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
index f866859855cd..1c3a72380fb8 100644
Quoted 7 lines

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 · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
#4 lore raw

Re: [PATCH 1/1] iio: accel: kionix-kx022a: Get the timestamp from the driver's private data in the trigger_handler

In reply to Matti Vaittinen

Hi Matti,

Quoted 9 lines · Matti Vaittinen
Quoted 8 lines · Matti Vaittinen
Quoted 7 lines · 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.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

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

#6 lore raw
In reply to Matti Vaittinen

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

[1] https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f

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

maintainer
#7 lore raw
Quoted 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

[1] https://lore.kernel.org/linux-iio/Y+%2FLpcc0Wa2VGsGO@carbian/T/#mec923c14d1324ffabfa88dde225eeb227005b48f

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