From: sashiko-bot@kernel.org
To: "Janani Sunil" <janani.sunil@analog.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH 3/6] iio: adc: adi-axi-adc: Add support for CRC
Date: Thu, 09 Jul 2026 09:14:49 +0000 [thread overview]
Message-ID: <20260709091450.855981F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260709-ad7768-driver-v1-3-44e1194fd96a@analog.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
New issues:
- [Medium] Incomplete implementation: missing `crc_enable` and `crc_disable` callbacks in AD485X and AD408X specific operations structures.
Pre-existing issues:
- [High] The mutex `st->lock` is never initialized in the driver's probe function.
--
--- Patch [3]: [PATCH 3/6] iio: adc: adi-axi-adc: Add support for CRC ---
commit c99754ea278319045472336d04b62842c05a3731
Author: Janani Sunil <janani.sunil@analog.com>
iio: adc: adi-axi-adc: Add support for CRC
Add support for enabling and disabling Cyclic Redundancy Check (CRC)
processing in the AXI ADC backend. CRC provides data integrity verification
for high-speed ADC data streams, ensuring reliable data transfer between
the ADC frontend and backend processing systems.
> diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c
> index 26b9c75bd4d8e..8af42d26aac08 100644
> --- a/drivers/iio/adc/adi-axi-adc.c
> +++ b/drivers/iio/adc/adi-axi-adc.c
[ ... ]
> @@ -615,6 +633,8 @@ static const struct iio_backend_ops adi_axi_adc_ops = {
> .num_lanes_set = axi_adc_num_lanes_set,
> .debugfs_reg_access = iio_backend_debugfs_ptr(axi_adc_reg_access),
> .debugfs_print_chan_status = iio_backend_debugfs_ptr(axi_adc_debugfs_print_chan_status),
> + .crc_enable = axi_adc_crc_enable,
> + .crc_disable = axi_adc_crc_disable,
> };
[Severity: Medium]
Did this patch introduce a regression where AD485X and AD408X backend
operations are missing the new CRC callbacks?
If a frontend driver for AD485X or AD408X tries to enable CRC via
iio_backend_crc_enable(), it will return -EOPNOTSUPP because the
callbacks are missing in their respective structures:
drivers/iio/adc/adi-axi-adc.c:
static const struct iio_backend_ops adi_ad485x_ops = {
.enable = axi_adc_enable,
...
.debugfs_print_chan_status =
iio_backend_debugfs_ptr(axi_adc_debugfs_print_chan_status),
/* crc_enable and crc_disable are NULL */
};
Should adi_ad485x_ops and adi_ad408x_ops also be updated?
[Severity: High]
This isn't a bug introduced by this patch, but I noticed the mutex
st->lock is never initialized during probe:
drivers/iio/adc/adi-axi-adc.c:adi_axi_adc_probe() {
...
st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
if (!st)
return -ENOMEM;
...
}
Because devm_kzalloc only zero-initializes the memory, the internal
wait_list for st->lock is left uninitialized.
When concurrent access occurs and hits the mutex slow path, won't this
cause a kernel panic due to a NULL pointer dereference? Should a call to
devm_mutex_init() be added here?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709-ad7768-driver-v1-0-44e1194fd96a@analog.com?part=3
next prev parent reply other threads:[~2026-07-09 9:14 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 8:50 [PATCH 0/6] iio: adc: Add AD7768/AD7768-4 ADC driver support Janani Sunil
2026-07-09 8:50 ` [PATCH 1/6] dt-bindings: iio: adc: Add AD7768 Janani Sunil
2026-07-09 8:59 ` sashiko-bot
2026-07-09 15:43 ` David Lechner
2026-07-10 0:33 ` Jonathan Cameron
2026-07-11 14:40 ` David Lechner
2026-07-12 1:39 ` Jonathan Cameron
2026-07-10 1:39 ` Jonathan Cameron
2026-07-09 8:50 ` [PATCH 2/6] iio: backend: Add support for CRC Janani Sunil
2026-07-09 9:03 ` sashiko-bot
2026-07-10 0:36 ` Jonathan Cameron
2026-07-09 8:50 ` [PATCH 3/6] iio: adc: adi-axi-adc: " Janani Sunil
2026-07-09 9:14 ` sashiko-bot [this message]
2026-07-09 15:54 ` David Lechner
2026-07-10 0:39 ` Jonathan Cameron
2026-07-10 0:46 ` Jonathan Cameron
2026-07-09 8:50 ` [PATCH 4/6] iio: adc: Add AD7768 IIO Driver support Janani Sunil
2026-07-09 9:27 ` sashiko-bot
2026-07-10 2:10 ` Jonathan Cameron
2026-07-10 7:41 ` Uwe Kleine-König
2026-07-09 8:50 ` [PATCH 5/6] gpio: ad7768: Add AD7768 GPIO auxiliary driver Janani Sunil
2026-07-09 9:38 ` sashiko-bot
2026-07-09 11:05 ` Andy Shevchenko
2026-07-10 2:14 ` Jonathan Cameron
2026-07-10 20:06 ` Linus Walleij
2026-07-09 8:50 ` [PATCH 6/6] Documentation: iio: Add AD7768 Documentation Janani Sunil
2026-07-09 9:41 ` sashiko-bot
2026-07-10 2:16 ` 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=20260709091450.855981F00A3A@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