Linux IIO development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: mike.looijmans@topic.nl
Cc: David Lechner <dlechner@baylibre.com>,
	Md Shofiqul Islam <shofiqtest@gmail.com>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	jic23@kernel.org, nuno.sa@analog.com, andy@kernel.org
Subject: Re: [PATCH v4 2/3] iio: adc: ti-ads1298: Fix incorrect timeout comment
Date: Mon, 11 May 2026 13:14:42 +0300	[thread overview]
Message-ID: <agGsEjB4jqafHhop@ashevche-desk.local> (raw)
In-Reply-To: <4bb77b6b-8bc0-4970-acf4-6a6ebf9ceab4@topic.nl>

On Mon, May 11, 2026 at 07:20:04AM +0200, mike.looijmans@topic.nl wrote:
> On 10-05-2026 08:59, Andy Shevchenko wrote:
> > On Sat, May 09, 2026 at 03:27:35PM -0500, David Lechner wrote:
> > > On 5/9/26 10:19 AM, Md Shofiqul Islam wrote:

...

> > > > -	/* Cannot take longer than 40ms (250Hz) */
> > > > +	/* Cannot take longer than 4ms at the lowest rate (250Hz) */
> > > >   	ret = wait_for_completion_timeout(&priv->completion, msecs_to_jiffies(50));
> > > I would say "lowest sample rate" so we know which rate it is talking about.
> > > 
> > > However, there could be latency in the kernel delaying the interrupt from
> > > firing. The kernel latency can be much larger (I've seen 100s of ms on old
> > > single core ARM CPUs). So I think we should mention that in the comment as
> > > well so that no one is tempted to set it to msecs_to_jiffies(5) (or 4). Even
> > > if that works most of the time on a fast machine, we may need the longer
> > > timeout on slower machines.

> > Actually it's not about fast/slow machine, it's about scheduler and load.
> > Even on the fast machine under heavy load the completion (if it's thread
> > based) may take quite a significant time to be delivered. For the hard IRQ
> > based completions it might be much better case, but nowadays it's more of
> > a niche.
> 
> This particular driver uses hard IRQ for delivering the data.

Does it set completion done at the interrupt handler?

> At the common
> sampling rate of 500 Hz, it generates interrupts at 1 kHz (each cycle needs
> one for the chip's data ready signal and one for the SPI controller).

Still, there are cases like PREEMPT_RT and threadirqs that makes this all
threaded.

> Although this particular case is the "single read", so there's indeed more
> scheduling involved.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2026-05-11 10:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-09 15:19 [PATCH v4 0/3] iio: adc: ti-ads1298: Minor driver cleanups Md Shofiqul Islam
2026-05-09 15:19 ` [PATCH v4 1/3] iio: adc: ti-ads1298: Add parentheses around macro parameter Md Shofiqul Islam
2026-05-09 11:38   ` Stepan Ionichev
2026-05-11 16:05     ` Jonathan Cameron
2026-05-09 15:19 ` [PATCH v4 2/3] iio: adc: ti-ads1298: Fix incorrect timeout comment Md Shofiqul Islam
2026-05-09 20:27   ` David Lechner
2026-05-10  6:59     ` Andy Shevchenko
2026-05-11  5:20       ` mike.looijmans
2026-05-11 10:14         ` Andy Shevchenko [this message]
2026-05-09 15:19 ` [PATCH v4 3/3] iio: adc: ti-ads1298: Remove unnecessary CONFIG2 write during init Md Shofiqul Islam
2026-05-09 20:36   ` David Lechner
2026-05-11 16:06     ` Jonathan Cameron
2026-05-11 17:59       ` mike.looijmans

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=agGsEjB4jqafHhop@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=mike.looijmans@topic.nl \
    --cc=nuno.sa@analog.com \
    --cc=shofiqtest@gmail.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