From: Jonathan Cameron <jic23@kernel.org>
To: Akshay Jindal <akshayaj.lkd@gmail.com>
Cc: anshulusr@gmail.com, dlechner@baylibre.com, nuno.sa@analog.com,
andy@kernel.org, shuah@kernel.org, linux-iio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] iio: light: ltr390: Add conditional data freshness check with sysfs control
Date: Mon, 28 Jul 2025 14:45:41 +0100 [thread overview]
Message-ID: <20250728144541.004f380a@jic23-huawei> (raw)
In-Reply-To: <CAE3SzaRMOFNxciCDQM5dUMTTONgAD8o7u-4hX=TDnLXs1wQ-hA@mail.gmail.com>
On Mon, 28 Jul 2025 01:42:19 +0530
Akshay Jindal <akshayaj.lkd@gmail.com> wrote:
> On Fri, Jul 25, 2025 at 12:24 AM Akshay Jindal <akshayaj.lkd@gmail.com> wrote:
> >
> > I agree that this will break the user behaviour.
> > Before dumping this off, I wanted to explore an idea.
> > What if this remains disabled by default, i.e. data->data_fresh_check_en = 0;
> > So this way the regular sensor read_data calls will not break, and
> > based on demand,
> > the application can configure the driver to check for data freshness,
> > by toggling the sysfs attribute to 1.
> > i.e. echo 1 | sudo tee /sys/bus/iio/devices/iio\:device0/data_fresh_check_enable
> >
> Hi,
> Is there any feedback on this?
It's a fairly esoteric interface in general. I'm not yet convinced there
is a reason to have such an indicator at all. Key here is that custom ABI
is (more or less) unused ABI that bit rots.
So I think there are three possible paths forwards
- Harden whatever algorithm you are feeding this data to so that it doesn't
matter if you get occasional duplicate data. i.e. make it a userspace problem.
- Handle the complexity of a buffered interface with freshness guarantee.
Basically that means polling for new data - typically checking at double
the expected sampling frequency and only pushing to the buffers if the
data is fresh.
- Propose generic support for such an indicator and show that it is useful
for a couple of devices and how we'd retrofit into existing drivers
cleanly.
Jonathan
>
> Thanks,
> Akshay.
next prev parent reply other threads:[~2025-07-28 13:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-21 19:54 [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness Akshay Jindal
2025-07-21 19:54 ` [PATCH 2/2] iio: light: ltr390: Add conditional data freshness check with sysfs control Akshay Jindal
2025-07-24 18:54 ` Akshay Jindal
2025-07-27 20:12 ` Akshay Jindal
2025-07-28 13:45 ` Jonathan Cameron [this message]
2025-07-21 20:25 ` [PATCH 1/2] iio: light: ltr390: Add sysfs attribute to report data freshness David Lechner
2025-07-22 3:55 ` Akshay Jindal
2025-07-22 21:15 ` David Lechner
2025-07-24 12:39 ` Jonathan Cameron
2025-07-24 16:55 ` Akshay Jindal
2025-07-24 17:41 ` David Lechner
2025-07-27 13:12 ` Jonathan Cameron
2025-07-23 14:02 ` Andy Shevchenko
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=20250728144541.004f380a@jic23-huawei \
--to=jic23@kernel.org \
--cc=akshayaj.lkd@gmail.com \
--cc=andy@kernel.org \
--cc=anshulusr@gmail.com \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=shuah@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
all inboxes | Powered by JetHome®