From: Jonathan Cameron <jic23@kernel.org>
To: Stephan Costa Barros <stephanbrrs8@gmail.com>
Cc: "David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Mike Looijmans" <mike.looijmans@topic.nl>,
"Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 3/6] iio: adc: ti-ads1298: fix scale, ID check, regmap and Kconfig
Date: Sun, 25 Oct 2026 23:12:37 +0000 [thread overview]
Message-ID: <20261025231237.55d4ebd0@jic23-hlaptop> (raw)
In-Reply-To: <20261024231335.280955-4-stephanbrrs8@gmail.com>
On Sat, 24 Oct 2026 20:13:32 -0300
Stephan Costa Barros <stephanbrrs8@gmail.com> wrote:
> Fix four smaller issues:
>
> - The scale divides the reference, in whole millivolts, by the gain
> before it is reported. With the internal 4 V reference, it is 0.099 %
> low at gain 6, 0.101 % at gain 12 and 0.025 % at gain 3. Report
> VREF / (gain * 2^23) as an IIO_VAL_FRACTIONAL; sysfs still shows it
> with nine decimals, now without the error.
Move this to end of the fixes. An accuracy improvement is nice to have
but not necessarily something anyone will backport if the previous driver
is working well enough for them. As with prior set, separate patch
per fix.
I appreciate that will mean a lot of patches, but they will each
be simpler to review.
>
> - Only the channel codes 0, 1 and 2 of the ID register are defined; an
> ID of 0x93, for example, gives 10 channels. The IIO core then reads
> past ads1298_channels, and the RDATA transfer writes past rx_buffer.
> Refuse the reserved codes as an unknown ID.
No problem with this, but it is hardening against devices we have
never seen. So after fixes and marked as hardening. We should never
have a fallback compatible issue on this, because they shouldn't
be using larger numbers of channels.
>
> - The driver uses regmap but does not select REGMAP, and fails to build
> where nothing else selects it, such as tinyconfig with SPI, IIO and
> TI_ADS1298 on x86_64.
Interesting we never saw this in random builds. Indeed good to fix
but has nothing to do with the rest of this patch.
>
> - Bit 0 of CONFIG3 is a read-only status bit and the GPIO register
> reads the pins, but both are cached, so a read through debugfs returns
> a stale value; debugfs can also write ID, LOFF_STATP and LOFF_STATN.
> Mark CONFIG3 and GPIO volatile, and the other three not writeable.
I don't really care about stale data in debugfs. By all means fix
this but it isn't something we'd bother backporting.
>
> The ID check was found by review and reproduced on an emulated device
> only, where KASAN reports the read past ads1298_channels.
>
> Fixes: 00ef7708fa60 ("iio: adc: ti-ads1298: Add driver")
> Signed-off-by: Stephan Costa Barros <stephanbrrs8@gmail.com>
next prev parent reply other threads:[~2026-10-25 23:12 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-24 23:13 [PATCH v2 0/6] iio: adc: ti-ads1298: fixes, and ADS1299 support Stephan Costa Barros
2026-10-24 23:13 ` [PATCH v2 1/6] iio: adc: ti-ads1298: fix the data read path Stephan Costa Barros
2026-10-25 20:14 ` Andy Shevchenko
2026-10-28 2:39 ` Stephan Costa Barros
2026-10-25 23:06 ` Jonathan Cameron
2026-10-28 2:19 ` Stephan Costa Barros
2026-10-24 23:13 ` [PATCH v2 2/6] iio: adc: ti-ads1298: fix power-up and clock handling Stephan Costa Barros
2026-10-25 20:18 ` Andy Shevchenko
2026-10-25 23:07 ` Jonathan Cameron
2026-10-26 6:27 ` Mike Looijmans
2026-10-28 2:19 ` Stephan Costa Barros
2026-10-28 6:47 ` Mike Looijmans
2026-10-24 23:13 ` [PATCH v2 3/6] iio: adc: ti-ads1298: fix scale, ID check, regmap and Kconfig Stephan Costa Barros
2026-10-25 23:12 ` Jonathan Cameron [this message]
2026-10-24 23:13 ` [PATCH v2 4/6] iio: adc: ti-ads1298: prepare for more chip families Stephan Costa Barros
2026-10-25 20:27 ` Andy Shevchenko
2026-10-28 2:22 ` Stephan Costa Barros
2026-10-25 23:26 ` Jonathan Cameron
2026-10-28 2:22 ` Stephan Costa Barros
2026-10-24 23:13 ` [PATCH v2 5/6] dt-bindings: iio: adc: ti,ads1298: add ADS1299 Stephan Costa Barros
2026-10-27 8:04 ` Krzysztof Kozlowski
2026-10-24 23:13 ` [PATCH v2 6/6] iio: adc: ti-ads1298: add ADS1299 support Stephan Costa Barros
2026-10-25 20:34 ` Andy Shevchenko
2026-10-28 2:30 ` Stephan Costa Barros
2026-10-25 23:34 ` Jonathan Cameron
2026-10-28 2:26 ` Stephan Costa Barros
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=20261025231237.55d4ebd0@jic23-hlaptop \
--to=jic23@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@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=robh@kernel.org \
--cc=stephanbrrs8@gmail.com \
--cc=u.kleine-koenig@baylibre.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®