All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Salih Erim" <salih.erim@amd.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v12 5/5] iio: adc: versal-sysmon: add oversampling support
Date: Wed, 24 Jun 2026 14:50:43 +0000	[thread overview]
Message-ID: <20260624145043.D91951F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260624143722.4047649-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 initialized to 1 without synchronizing with actual hardware state.
--

commit 943b70956fe7374b433e643428ed243156f1fcae
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. It exposes shared oversampling
configuration at the channel type level for temperature and supply channels.

> diff --git a/drivers/iio/adc/versal-sysmon-core.c b/drivers/iio/adc/versal-sysmon-core.c
> index 8f2c502d9cb6d..1b55d343982ef 100644
> --- a/drivers/iio/adc/versal-sysmon-core.c
> +++ b/drivers/iio/adc/versal-sysmon-core.c

[ ... ]

> @@ -846,6 +999,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]
Can the software cache become out of sync with the actual hardware state here?

If the platform firmware previously configured the SysMon IP to perform
oversampling, hardcoding these values to 1 without reading the current
hardware configuration might result in the IIO sysfs oversampling_ratio
attribute reporting an incorrect value to userspace.

Should the driver read the hardware configuration (via SYSMON_CONFIG) to
initialize these fields, or explicitly reset the hardware ratio to 1 during
probe?

>  
>  	ret = devm_mutex_init(dev, &sysmon->lock);
>  	if (ret)

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260624143722.4047649-1-salih.erim@amd.com?part=5

      reply	other threads:[~2026-06-24 14:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 14:37 [PATCH v12 0/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-24 14:37 ` [PATCH v12 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-24 14:37 ` [PATCH v12 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-24 14:37 ` [PATCH v12 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-24 14:50   ` sashiko-bot
2026-06-24 14:37 ` [PATCH v12 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-24 14:53   ` sashiko-bot
2026-06-24 14:37 ` [PATCH v12 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-24 14:50   ` 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=20260624145043.D91951F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.