Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jakub Szczudlo" <jakubszczudlo40@gmail.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v7 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110
Date: Tue, 14 Jul 2026 20:04:56 +0000	[thread overview]
Message-ID: <20260714200456.943621F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260714195528.597753-3-jakubszczudlo40@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Logic error in ads1100_poll_data_ready causes a 7.5 second hang and -ETIMEDOUT on every configuration change
--

--- Patch [2]: [PATCH v7 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110 ---
commit 020c9fd2512b9b8cdb2cbcd5179eab372c1ab0a5
Author: Jakub Szczudlo <jakubszczudlo40@gmail.com>

dt-bindings: iio: adc: ti,ads1100: add support for ADS1110
    
Register layouts are the same as for ADS1100 but ADS1110 have different
data rates and have internal voltage reference that is always 2.048V.
Also correct order of ads so they will be sorted alphabetically.

> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,ads1100.yaml b/Documentation/devicetree/bindings/iio/adc/ti,ads1100.yaml
> index 970ccab15e1ec..28c5e2dd0ad62 100644
> --- a/Documentation/devicetree/bindings/iio/adc/ti,ads1100.yaml
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,ads1100.yaml

[ ... ]

[Severity: High]
Does this logic in ads1100_poll_data_ready() cause a timeout on every
configuration change?

In drivers/iio/adc/ti-ads1100.c:ads1100_poll_data_ready():

	ret = readx_poll_timeout(ads1100_new_data_is_ready, data,
				 data_ready, data_ready != 0,
				 wait_time_us, ADS1100_MAX_DRDY_TIMEOUT_US);
	if (ret)
		return ret;

And in ads1100_new_data_is_ready():

	return FIELD_GET(ADS1100_CFG_ST_BSY, buffer[2]);

When the device operates in continuous conversion mode (enforced by
ads1100_runtime_resume before the polling loop), the datasheet specifies
that the ST/BSY bit is always 0.

Since data_ready is always 0, the condition data_ready != 0 evaluates
to false on every iteration. Will the polling loop always block for the
maximum timeout of 7.5 seconds (ADS1100_MAX_DRDY_TIMEOUT_US) and return
-ETIMEDOUT?

This breaks sysfs writes to scale and sampling frequency, severely
impacting driver usability and causing large delays.

Furthermore, even if the device was in single-shot mode, breaking when
data_ready != 0 means it would exit immediately while BUSY (1), instead
of waiting for the conversion to complete (0).

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260714195528.597753-1-jakubszczudlo40@gmail.com?part=2

  reply	other threads:[~2026-07-14 20:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-14 19:55 [PATCH v7 0/3] iio: adc: ti-ads1100: Add support for TI ADS1110 to ti-ads1100 driver Jakub Szczudlo
2026-07-14 19:55 ` [PATCH v7 1/3] iio: adc: ti-ads1100: Fix incorrect reading when datarate changed in single mode Jakub Szczudlo
2026-07-14 20:10   ` sashiko-bot
2026-07-14 19:55 ` [PATCH v7 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110 Jakub Szczudlo
2026-07-14 20:04   ` sashiko-bot [this message]
2026-07-14 19:55 ` [PATCH v7 3/3] iio: adc: ti-ads1100: Add ti-ads1110 support to ti-ads1100 driver Jakub Szczudlo
2026-07-14 20:07   ` sashiko-bot
2026-07-14 20:18   ` David Lechner
2026-07-14 20:20 ` [PATCH v7 0/3] iio: adc: ti-ads1100: Add support for TI ADS1110 " David Lechner
  -- strict thread matches above, loose matches on Subject: below --
2026-07-14 19:47 Jakub Szczudlo
2026-07-14 19:47 ` [PATCH v7 2/3] dt-bindings: iio: adc: ti,ads1100: add support for ADS1110 Jakub Szczudlo

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=20260714200456.943621F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jakubszczudlo40@gmail.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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