From: sashiko-bot@kernel.org
To: "Salih Erim" <salih.erim@amd.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v9 5/5] iio: adc: versal-sysmon: add oversampling support
Date: Wed, 17 Jun 2026 21:07:54 +0000 [thread overview]
Message-ID: <20260617210755.343BC1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260617180147.3370346-6-salih.erim@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Software cache for oversampling ratios is unconditionally initialized to 1, potentially causing desynchronization with the actual hardware configuration.
--
commit 81ca0dc5aa386dec0337a8e068370935d45ea78e
Author: Salih Erim <salih.erim@amd.com>
iio: adc: versal-sysmon: add oversampling support
This commit adds support for reading and writing the oversampling ratio
through the IIO oversampling_ratio attribute. The hardware supports averaging
2, 4, 8, or 16 samples, plus a ratio of 1 for no averaging.
> diff --git a/drivers/iio/adc/versal-sysmon-core.c b/drivers/iio/adc/versal-sysmon-core.c
> index 19a8edd89198c..16f474c1bffae 100644
> --- a/drivers/iio/adc/versal-sysmon-core.c
> +++ b/drivers/iio/adc/versal-sysmon-core.c
[ ... ]
> @@ -832,6 +981,8 @@ int devm_versal_sysmon_core_probe(struct device *dev, struct regmap *regmap)
>
> sysmon = iio_priv(indio_dev);
> sysmon->regmap = regmap;
> + sysmon->temp_oversampling = 1;
> + sysmon->supply_oversampling = 1;
[Severity: Medium]
Could this software cache initialization become desynchronized with the actual
hardware configuration?
The oversampling variables are initialized to 1 unconditionally, without
reading the SYSMON_CONFIG hardware register or actively writing this default
value down to the hardware.
If the bootloader or a previous kernel instance (such as through kexec)
configured an oversampling ratio other than 1, will the hardware continue
averaging samples while userspace incorrectly reads '1' from the IIO
oversampling ratio attribute?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260617180147.3370346-1-salih.erim@amd.com?part=5
prev parent reply other threads:[~2026-06-17 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-17 18:01 [PATCH v9 0/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-17 18:01 ` [PATCH v9 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-17 18:01 ` [PATCH v9 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-17 18:01 ` [PATCH v9 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-17 20:47 ` sashiko-bot
2026-06-17 18:01 ` [PATCH v9 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-17 21:01 ` sashiko-bot
2026-06-17 18:01 ` [PATCH v9 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-17 21:07 ` sashiko-bot [this message]
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=20260617210755.343BC1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=salih.erim@amd.com \
--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