mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: David Lechner <dlechner@baylibre.com>
Cc: Paul Geurts <paul.geurts@prodrive-technologies.com>,
	jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	tobias.sperling@softing.com
Subject: Re: [PATCH v2] iio: ti-ads7138: Disable STATS_EN bit while reading conversion results
Date: Sat, 20 Jun 2026 09:36:25 +0300	[thread overview]
Message-ID: <ajY0pjnnzQX0IQm1@ashevche-desk.local> (raw)
In-Reply-To: <af4dd7a8-4823-4f84-bc88-4b5d8d35237e@baylibre.com>

On Fri, Jun 19, 2026 at 09:42:08AM -0500, David Lechner wrote:
> On 6/19/26 4:00 AM, Paul Geurts wrote:
> > The device might update channel data while it's read by the host,
> > providing a data race. Disable the update of the channel stats before
> > reading the values.
> 
> This description seems a bit short on details. It looks like this
> driver doesn't support buffered reads. So if we disable statistics
> during a direct read, why would we want to enable statistics in
> the first place?

I believe this patch is initiated by
"Until a new conversion result is available, previous values can be read from
the statistics registers. Before reading the statistics registers, set STATS_EN
to 0 to prevent any updates to this register block."
from the datasheet.

I would rather like to know if this is IRL problem, or just a datasheet reading
based code.

> (This driver suffers from the comments say "what" rather than "why"
> /* Enable statistics and digital window comparator */ so it is hard
> to say what the original intention was.)
> 
> Can you explain more what this race condition is about and what
> happens before the fix vs. after the fix? People generally do this
> with two columns showing concurrent function calls.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-06-20  6:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-19  9:00 Paul Geurts
2026-06-19 14:42 ` David Lechner
2026-06-20  6:36   ` Andy Shevchenko [this message]
2026-06-23 12:52     ` Paul Geurts
2026-06-23 14:56       ` David Lechner
2026-06-24  7:24         ` Paul Geurts

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=ajY0pjnnzQX0IQm1@ashevche-desk.local \
    --to=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=paul.geurts@prodrive-technologies.com \
    --cc=tobias.sperling@softing.com \
    /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®