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 v6 09/16] iio: frequency: ad9910: initial driver implementation
Date: Thu, 18 Jun 2026 13:37:48 +0000 [thread overview]
Message-ID: <20260618133749.470C31F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260618-ad9910-iio-driver-v6-9-79125ffbe430@analog.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Hardware sequencing violation: reference clock and GPIO powerdown action are initialized before device regulators, causing backpowering.
--
commit 71fb9226243ea37baeab1cd6841703ff6cde346d
Author: Rodrigo Alencar <rodrigo.alencar@analog.com>
Subject: iio: frequency: ad9910: initial driver implementation
This commit adds the core AD9910 DDS driver infrastructure with single tone
mode support, including SPI register access, profile management via GPIO pins,
and PLL/DAC configuration from firmware properties.
> diff --git a/drivers/iio/frequency/ad9910.c b/drivers/iio/frequency/ad9910.c
> new file mode 100644
> index 0000000000000..95b01295e4a0a
> --- /dev/null
> +++ b/drivers/iio/frequency/ad9910.c
[ ... ]
> +static int ad9910_probe(struct spi_device *spi)
> +{
[ ... ]
> + st->refclk = devm_clk_get_enabled(dev, "ref_clk");
> + if (IS_ERR(st->refclk))
> + return dev_err_probe(dev, PTR_ERR(st->refclk),
> + "Failed to get reference clock\n");
[ ... ]
> + st->gpio_pwdown = devm_gpiod_get_optional(dev, "powerdown",
> + GPIOD_OUT_LOW);
> + if (IS_ERR(st->gpio_pwdown))
> + return dev_err_probe(dev, PTR_ERR(st->gpio_pwdown),
> + "failed to get powerdown gpio\n");
> +
> + ret = devm_add_action_or_reset(dev, ad9910_hw_powerdown_action, st);
> + if (ret)
> + return dev_err_probe(dev, ret,
> + "failed to add hw powerdown action\n");
> +
> + ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(supplies), supplies);
> + if (ret)
> + return dev_err_probe(dev, ret, "Failed to get regulators\n");
[Severity: High]
Could this initialization order cause the device to be backpowered?
In ad9910_probe(), the reference clock is enabled and the hardware powerdown
cleanup action is registered before the device's regulators are enabled. This
might drive an active clock signal into the unpowered IC during the probe
sequence.
Additionally, because devres executes cleanup actions in reverse order (LIFO),
if a probe failure occurs later or the driver unbinds, the regulators will be
turned off first. The powerdown GPIO would then be driven high and the
reference clock would continue to toggle into an unpowered chip until they
are subsequently disabled.
Driving active digital signals into an unpowered CMOS device forward-biases
its internal ESD protection diodes, which can lead to latch-up or permanent
hardware damage. Should the regulators be enabled prior to applying any
clock or active GPIO signals?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260618-ad9910-iio-driver-v6-0-79125ffbe430@analog.com?part=9
next prev parent reply other threads:[~2026-06-18 13:37 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-18 13:27 [PATCH v6 00/16] AD9910 Direct Digital Synthesizer Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 01/16] iio: ABI: add attributes for altcurrent channels Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 02/16] iio: ABI: scale and offset for frequency/phase channels Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 03/16] iio: ABI: add parent entry for iio channels Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 04/16] iio: add IIO_FREQUENCY channel type Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 05/16] iio: core: support 64-bit register through debugfs Rodrigo Alencar via B4 Relay
2026-06-18 14:45 ` Nuno Sá
2026-06-18 13:27 ` [PATCH v6 06/16] iio: core: create local __iio_chan_prefix_emit() for reuse Rodrigo Alencar via B4 Relay
2026-06-18 15:06 ` Nuno Sá
2026-06-18 13:27 ` [PATCH v6 07/16] iio: core: add hierarchical channel relationships Rodrigo Alencar via B4 Relay
2026-06-18 13:33 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 08/16] dt-bindings: iio: frequency: add ad9910 Rodrigo Alencar via B4 Relay
2026-06-18 13:35 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 09/16] iio: frequency: ad9910: initial driver implementation Rodrigo Alencar via B4 Relay
2026-06-18 13:37 ` sashiko-bot [this message]
2026-06-18 13:27 ` [PATCH v6 10/16] iio: frequency: ad9910: add basic parallel port support Rodrigo Alencar via B4 Relay
2026-06-18 13:41 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 11/16] iio: frequency: ad9910: add digital ramp generator support Rodrigo Alencar via B4 Relay
2026-06-18 13:42 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 12/16] iio: frequency: ad9910: add RAM mode support Rodrigo Alencar via B4 Relay
2026-06-18 13:43 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 13/16] iio: frequency: ad9910: add output shift keying support Rodrigo Alencar via B4 Relay
2026-06-18 13:27 ` [PATCH v6 14/16] iio: frequency: ad9910: show channel priority in debugfs Rodrigo Alencar via B4 Relay
2026-06-18 13:45 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 15/16] iio: ABI: add docs for ad9910 sysfs entries Rodrigo Alencar via B4 Relay
2026-06-18 13:44 ` sashiko-bot
2026-06-18 13:27 ` [PATCH v6 16/16] docs: iio: add documentation for ad9910 driver 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=20260618133749.470C31F000E9@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