Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Rodrigo Alencar via B4 Relay"
	<devnull+rodrigo.alencar.analog.com@kernel.org>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v5 06/12] iio: dac: ad5686: consume optional reset signal
Date: Sun, 28 Jun 2026 14:21:17 +0000	[thread overview]
Message-ID: <20260628142118.2165D1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260628-ad5686-new-features-v5-6-577caadbf7c0@analog.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:

New issues:
- [High] The return values of `reset_control_assert()` and `reset_control_deassert()` are ignored.
- [Medium] Missing reset recovery delay after hardware reset deassertion.

Pre-existing issues:
- [High] The driver unconditionally requires the `vdd` and `vlogic` regulators, breaking probe on older device trees on platforms with full regulator constraints.
--

commit a475ccccddaa1769cffb9d807bfd0a081ce1514a
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>

iio: dac: ad5686: consume optional reset signal

Add RESET pin GPIO support through an optional reset control, which is
local to the probe function. A reset pulse is manually generated after
the device is powered up.

> diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c
> index e2ebabca68873..8ad8931a3d7f8 100644
> --- a/drivers/iio/dac/ad5686.c
> +++ b/drivers/iio/dac/ad5686.c

[ ... ]

> @@ -486,6 +488,11 @@ int ad5686_probe(struct device *dev,
>  	st->ops = ops;
>  	st->chip_info = chip_info;
>  
> +	rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
> +	if (IS_ERR(rstc))
> +		return dev_err_probe(dev, PTR_ERR(rstc),
> +				     "Failed to get reset control\n");
> +
>  	ret = devm_regulator_get_enable(dev, "vdd");
>  	if (ret)
>  		return dev_err_probe(dev, ret, "failed to enable vdd supply\n");

[Severity: High]
This is a pre-existing issue, but does unconditionally requesting the vdd
supply here break backwards compatibility for older device trees?

If a platform boots with an older device tree that lacks these supplies and
full regulator constraints are applied, the regulator framework might return
-ENODEV and cause ad5686_probe() to abort, breaking probe on older systems.

[ ... ]

> @@ -509,6 +516,11 @@ int ad5686_probe(struct device *dev,
>  	/* 4.5us power-up time: Datasheet Table 4: Timing Characteristics */
>  	fsleep(5);
>  
> +	/* 1us >> 30ns reset pulse activation time: Datasheet Table 4 */
> +	reset_control_assert(rstc);
> +	fsleep(1);
> +	reset_control_deassert(rstc);

[Severity: High]
Can the return values of reset_control_assert() and reset_control_deassert()
be ignored here?

If the underlying reset controller (e.g., an I2C/SPI GPIO expander) encounters
a communication error, it could return a negative error code like -EIO. The
device might then remain stuck in a physical reset state, causing subsequent
communication to silently fail rather than failing early during probe with a
clear error message.

[Severity: Medium]
Is a reset recovery delay needed after deasserting the reset control before
moving on?

Since there is no explicit delay after deassertion, fast CPUs might begin
sending the first SPI/I2C commands before the DAC's internal state machine
has finished initializing from the hard reset.

> +
>  	/* Initialize masks to all ones */
>  	st->pwr_down_mask = ~0;
>  	st->pwr_down_mode = ~0;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260628-ad5686-new-features-v5-0-577caadbf7c0@analog.com?part=6

  reply	other threads:[~2026-06-28 14:21 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-28 14:08 [PATCH v5 00/12] New features for the AD5686 IIO driver Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 01/12] dt-bindings: iio: dac: ad5696: add reset/ldac/gain support Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 02/12] dt-bindings: iio: dac: ad5696: rework on power supplies Rodrigo Alencar via B4 Relay
2026-06-28 14:19   ` sashiko-bot
2026-06-28 14:08 ` [PATCH v5 03/12] dt-bindings: iio: dac: ad5686: add reset/ldac/gain support Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 04/12] dt-bindings: iio: dac: ad5686: rework on power supplies Rodrigo Alencar via B4 Relay
2026-06-28 14:19   ` sashiko-bot
2026-06-28 14:08 ` [PATCH v5 05/12] iio: dac: ad5686: add support for missing " Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 06/12] iio: dac: ad5686: consume optional reset signal Rodrigo Alencar via B4 Relay
2026-06-28 14:21   ` sashiko-bot [this message]
2026-06-28 14:08 ` [PATCH v5 07/12] iio: dac: ad5686: add ldac gpio Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 08/12] iio: dac: ad5686: introduce sync operation Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 09/12] iio: dac: ad5686: implement new sync() op for the spi bus Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 10/12] iio: dac: ad5686: read_raw/write_raw: use guard(mutex)() Rodrigo Alencar via B4 Relay
2026-06-28 14:08 ` [PATCH v5 11/12] iio: dac: ad5686: add triggered buffer support Rodrigo Alencar via B4 Relay
2026-06-28 14:30   ` sashiko-bot
2026-06-28 14:08 ` [PATCH v5 12/12] iio: dac: ad5686: add gain control support Rodrigo Alencar via B4 Relay

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=20260628142118.2165D1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+rodrigo.alencar.analog.com@kernel.org \
    --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