Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Janani Sunil" <janani.sunil@analog.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/2] iio: dac: Add AD5529R DAC driver support
Date: Tue, 09 Jun 2026 15:10:46 +0000	[thread overview]
Message-ID: <20260609151046.C734B1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260609-ad5529r-driver-v4-2-2e4c02234a1a@analog.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The hardware reset logic fails to guarantee a reset pulse and skips software reset, breaking module reload.
--

commit e9e9fe5da17e349af411f3cecc999fcff44de1e2
Author: Janani Sunil <janani.sunil@analog.com>

iio: dac: Add AD5529R DAC driver support

This commit adds driver support for the Analog Devices AD5529R 16-channel,
12/16-bit DAC. It provides basic IIO voltage output capabilities and supports
configuring output ranges.

> diff --git a/drivers/iio/dac/ad5529r.c b/drivers/iio/dac/ad5529r.c
> new file mode 100644
> index 0000000000000..d2d0287d0f951
> --- /dev/null
> +++ b/drivers/iio/dac/ad5529r.c

[ ... ]

> +static int ad5529r_reset(struct ad5529r_state *st)
> +{
> +	struct reset_control *rst;
> +	int ret;
> +
> +	rst = devm_reset_control_get_optional_exclusive(&st->spi->dev, NULL);
> +	if (IS_ERR(rst))
> +		return PTR_ERR(rst);
> +
> +	if (rst) {
> +		ret = reset_control_deassert(rst);
> +		if (ret)
> +			return ret;
> +	} else {
> +		ret = regmap_write(st->regmap_8bit, AD5529R_REG_INTERFACE_CONFIG_A,
> +				   AD5529R_INTERFACE_CONFIG_A_SW_RESET);
> +		if (ret)
> +			return ret;
> +	}

[Severity: High]
Does this code ensure the device is actually reset on driver reload?

If the driver is unbound and rebound, the hardware reset line might already
be deasserted. Since reset_control_deassert() is called without a prior
assert, and there is no teardown action registered to assert the line on
unbind, will the device fail to receive a physical reset pulse?

Because a hardware reset control is present, the software reset in the else
block is also skipped. Could this combination leave the device in an
unpredictable state on subsequent probes?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260609-ad5529r-driver-v4-0-2e4c02234a1a@analog.com?part=2

  reply	other threads:[~2026-06-09 15:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09 15:00 [PATCH v4 0/2] iio: dac: Add support for AD5529R DAC Janani Sunil
2026-06-09 15:00 ` [PATCH v4 1/2] dt-bindings: iio: dac: Add AD5529R Janani Sunil
2026-06-09 15:58   ` Conor Dooley
2026-06-09 15:00 ` [PATCH v4 2/2] iio: dac: Add AD5529R DAC driver support Janani Sunil
2026-06-09 15:10   ` sashiko-bot [this message]
2026-06-09 18:44   ` Andy Shevchenko

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=20260609151046.C734B1F00893@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=janani.sunil@analog.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