From: David Lechner <dlechner@baylibre.com>
To: Md Shofiqul Islam <shofiqtest@gmail.com>,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: jic23@kernel.org, mike.looijmans@topic.nl, nuno.sa@analog.com,
andy@kernel.org, andriy.shevchenko@intel.com
Subject: Re: [PATCH v4 2/3] iio: adc: ti-ads1298: Fix incorrect timeout comment
Date: Sat, 9 May 2026 15:27:35 -0500 [thread overview]
Message-ID: <f6189816-a157-466d-80bc-3f338c13d69b@baylibre.com> (raw)
In-Reply-To: <20260509151959.3475-3-shofiqtest@gmail.com>
On 5/9/26 10:19 AM, Md Shofiqul Islam wrote:
> At the lowest supported data rate of 250Hz, one conversion period is
> 4ms, not 40ms. Fix the comment to correctly reflect the timing.
> The 50ms timeout value itself is correct as a conservative margin.
>
> Signed-off-by: Md Shofiqul Islam <shofiqtest@gmail.com>
> ---
> drivers/iio/adc/ti-ads1298.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/adc/ti-ads1298.c b/drivers/iio/adc/ti-ads1298.c
> index cf5f954206..186bda3087 100644
> --- a/drivers/iio/adc/ti-ads1298.c
> +++ b/drivers/iio/adc/ti-ads1298.c
> @@ -210,7 +210,7 @@ static int ads1298_read_one(struct ads1298_private *priv, int chan_index)
> return ret;
> }
>
> - /* 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.
> if (!ret)
> return -ETIMEDOUT;
next prev parent reply other threads:[~2026-05-09 20:27 UTC|newest]
Thread overview: 9+ 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-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 [this message]
2026-05-10 6:59 ` Andy Shevchenko
2026-05-11 5:20 ` mike.looijmans
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
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=f6189816-a157-466d-80bc-3f338c13d69b@baylibre.com \
--to=dlechner@baylibre.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--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