From: sashiko-bot@kernel.org
To: "Petar Stepanovic" <pstepanovic@axiado.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH 2/3] iio: adc: add Axiado SARADC driver
Date: Thu, 28 May 2026 08:39:52 +0000 [thread overview]
Message-ID: <20260528083952.BF1781F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260528-axiado-ax3000-ax3005-saradc-v1-2-345dd5f6608a@axiado.com>
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [Medium] The SARADC hardware block is enabled during probe but is never explicitly disabled on driver unbind or probe failure.
- [Medium] The power-down (PD) bit is toggled with no delay, resulting in an ineffective reset or power cycle pulse.
- [Medium] The IIO device name is initialized with `dev_name()`, which violates the IIO sysfs ABI.
--
commit 14677b4fe42ae6002d14ca13458223da2d275626
Author: Petar Stepanovic <pstepanovic@axiado.com>
iio: adc: add Axiado SARADC driver
Add support for the SARADC controller found on Axiado AX3000 and AX3005 SoCs.
The driver supports single-shot voltage reads through the IIO subsystem,
dynamically selecting the number of available channels from SoC match data.
> diff --git a/drivers/iio/adc/axiado_saradc.c b/drivers/iio/adc/axiado_saradc.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/iio/adc/axiado_saradc.c
[ ... ]
> +static int axiado_saradc_probe(struct platform_device *pdev)
> +{
[ ... ]
> + mutex_init(&info->lock);
> + reg = FIELD_PREP(AX_SARADC_CH_EN_MASK,
> + GENMASK(soc_data->num_channels - 1, 0)) |
> + AX_SARADC_SAMPLE_16 | AX_SARADC_MODE | AX_SARADC_ENABLE;
> +
> + iowrite32(AX_SARADC_PD, info->regs + AX_SARADC_GLOBAL_CTRL);
> + iowrite32(reg, info->regs + AX_SARADC_GLOBAL_CTRL);
[Severity: Medium]
Is this reset or power cycle sequence effective without a delay?
The power-down (PD) bit is toggled with no delay between writes, and without
a read-back to flush the write buffer. This typically results in a
zero-width pulse that hardware might not register.
Does the hardware require a short sleep or a dummy read here to ensure the
analog components properly reset?
> +
> + indio_dev->name = dev_name(&pdev->dev);
[Severity: Medium]
Will this name format break the IIO sysfs ABI?
The driver initializes the IIO device name using dev_name(). For device tree
nodes, this usually includes the bus address and a dot, such as
12340000.saradc.
The IIO sysfs ABI dictates that the device name attribute must not contain
whitespace, dashes, or dots. Could a hardcoded driver string or the
compatible string be used instead to avoid breaking userspace applications?
> + indio_dev->dev.parent = &pdev->dev;
> + indio_dev->info = &axiado_saradc_iio_info;
> + indio_dev->modes = INDIO_DIRECT_MODE;
> + indio_dev->channels = axiado_saradc_iio_channels;
> + indio_dev->num_channels = soc_data->num_channels;
> +
> + ret = devm_iio_device_register(&pdev->dev, indio_dev);
> + if (ret)
> + return dev_err_probe(&pdev->dev, ret,
> + "failed to register IIO device\n");
> +
> + return 0;
> +}
[Severity: Medium]
Is there a missing cleanup step to disable the SARADC hardware block?
During probe, the hardware is enabled by writing AX_SARADC_ENABLE to the
global control register. However, the driver does not seem to register a
devm action or provide a remove callback to clear this bit and power down
the ADC.
When the driver unbinds or probe fails, standard devres will gate the clock
and disable the regulator while the ADC block is still logically active.
Does disabling clocks on active hardware lead to system bus lockups or power
leaks on these SoCs?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260528-axiado-ax3000-ax3005-saradc-v1-0-345dd5f6608a@axiado.com?part=2
next prev parent reply other threads:[~2026-05-28 8:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-28 8:10 [PATCH 0/3] Subject: [PATCH 0/3] iio: adc: Add Axiado SARADC driver Petar Stepanovic
2026-05-28 8:10 ` [PATCH 1/3] dt-bindings: iio: adc: add Axiado AX3000/AX3005 SARADC Petar Stepanovic
2026-05-28 9:20 ` Jonathan Cameron
2026-05-28 16:58 ` Conor Dooley
2026-05-28 8:10 ` [PATCH 2/3] iio: adc: add Axiado SARADC driver Petar Stepanovic
2026-05-28 8:39 ` sashiko-bot [this message]
2026-05-28 9:02 ` Joshua Crofts
2026-05-28 9:44 ` Jonathan Cameron
2026-05-28 8:10 ` [PATCH 3/3] MAINTAINERS: add Axiado SARADC driver entry Petar Stepanovic
2026-05-28 8:29 ` Joshua Crofts
2026-05-28 9:17 ` [PATCH 0/3] Subject: [PATCH 0/3] iio: adc: Add Axiado SARADC driver Jonathan Cameron
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=20260528083952.BF1781F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=pstepanovic@axiado.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