From: Jonathan Cameron <jic23@kernel.org>
To: Petre Rodan <petre.rodan@subdimension.ro>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 11/18] iio: accel: bma220: populate buffer ts in trigger handler
Date: Sat, 27 Sep 2025 15:07:29 +0100 [thread overview]
Message-ID: <20250927150729.786e29d8@jic23-huawei> (raw)
In-Reply-To: <20250913-b4-bma220_improvements-v3-11-0b97279b4e45@subdimension.ro>
On Sat, 13 Sep 2025 18:39:32 +0300
Petre Rodan <petre.rodan@subdimension.ro> wrote:
> Populate buffer timestamps in trigger handler instead of in the
> top half. Otherwise all timestamps read zero.
Say why. Key here is that not all triggers can run the top half handler
that provides pf->timestamp. Use an example of which ever one you are
testing this with.
>
> Signed-off-by: Petre Rodan <petre.rodan@subdimension.ro>
> ---
> v2->v3 split out from bigger patch (Jonathan)
> ---
> drivers/iio/accel/bma220_core.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/accel/bma220_core.c b/drivers/iio/accel/bma220_core.c
> index 73ce9a9511734961c2c6dadc99c21418070dce00..728bf08c2cfb250266be56e69b11af4b6c4a1347 100644
> --- a/drivers/iio/accel/bma220_core.c
> +++ b/drivers/iio/accel/bma220_core.c
> @@ -188,7 +188,7 @@ static irqreturn_t bma220_trigger_handler(int irq, void *p)
> return IRQ_NONE;
>
> iio_push_to_buffers_with_ts(indio_dev, &data->scan, sizeof(data->scan),
> - pf->timestamp);
> + iio_get_time_ns(indio_dev));
> iio_trigger_notify_done(indio_dev->trig);
>
> return IRQ_HANDLED;
> @@ -409,8 +409,7 @@ int bma220_common_probe(struct device *dev, struct regmap *regmap, int irq)
> if (ret)
> return ret;
>
> - ret = devm_iio_triggered_buffer_setup(dev, indio_dev,
> - iio_pollfunc_store_time,
> + ret = devm_iio_triggered_buffer_setup(dev, indio_dev, NULL,
> bma220_trigger_handler, NULL);
> if (ret < 0)
> dev_err_probe(dev, ret, "iio triggered buffer setup failed\n");
>
next prev parent reply other threads:[~2025-09-27 14:07 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-13 15:39 [PATCH v3 00/18] iio: accel: bma220 improvements Petre Rodan
2025-09-13 15:39 ` [PATCH v3 01/18] dt-bindings: iio: accel: bosch,bma220 cleanup typo Petre Rodan
2025-09-13 15:39 ` [PATCH v3 02/18] dt-bindings: iio: accel: bosch,bma220 setup SPI clock mode Petre Rodan
2025-09-13 15:39 ` [PATCH v3 03/18] dt-bindings: iio: accel: bosch,bma220 set irq type in example block Petre Rodan
2025-09-18 2:08 ` Krzysztof Kozlowski
2025-09-27 14:00 ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 04/18] iio: accel: bma220: split original driver Petre Rodan
2025-09-14 12:45 ` Andy Shevchenko
2025-09-15 5:05 ` Petre Rodan
2025-09-13 15:39 ` [PATCH v3 05/18] iio: accel: bma220: add open firmware table Petre Rodan
2025-09-13 15:39 ` [PATCH v3 06/18] iio: accel: bma220: turn power supplies on Petre Rodan
2025-09-14 12:04 ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 07/18] iio: accel: bma220: move bma220_power() fct Petre Rodan
2025-09-14 12:05 ` Andy Shevchenko
2025-09-27 14:04 ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 08/18] iio: accel: bma220: reset registers during init stage Petre Rodan
2025-09-14 12:07 ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 09/18] iio: accel: bma220: relax constraints during probe() Petre Rodan
2025-09-14 12:13 ` Andy Shevchenko
2025-09-13 15:39 ` [PATCH v3 10/18] iio: accel: bma220: migrate to regmap API Petre Rodan
2025-09-14 12:21 ` Andy Shevchenko
2025-09-15 5:49 ` Petre Rodan
2025-09-13 15:39 ` [PATCH v3 11/18] iio: accel: bma220: populate buffer ts in trigger handler Petre Rodan
2025-09-27 14:07 ` Jonathan Cameron [this message]
2025-09-13 15:39 ` [PATCH v3 12/18] iio: accel: bma220: use find_match_table fct Petre Rodan
2025-09-13 15:39 ` [PATCH v3 13/18] iio: accel: bma220: add i2c module Petre Rodan
2025-09-13 15:39 ` [PATCH v3 14/18] iio: accel: bma220: add i2c watchdog feature Petre Rodan
2025-09-13 15:39 ` [PATCH v3 15/18] iio: accel: bma220: add interrupt trigger Petre Rodan
2025-09-13 16:32 ` Petre Rodan
2025-09-14 12:09 ` Andy Shevchenko
2025-09-13 18:12 ` kernel test robot
2025-09-14 12:12 ` Andy Shevchenko
2025-09-27 14:12 ` Jonathan Cameron
2025-09-13 15:39 ` [PATCH v3 16/18] iio: accel: bma220: add LPF cut-off frequency mapping Petre Rodan
2025-09-13 15:39 ` [PATCH v3 17/18] iio: accel: bma220: add debugfs reg access Petre Rodan
2025-09-13 15:39 ` [PATCH v3 18/18] iio: accel: bma220: add maintainer Petre Rodan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250927150729.786e29d8@jic23-huawei \
--to=jic23@kernel.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=petre.rodan@subdimension.ro \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox