From: sashiko-bot@kernel.org
To: "Salih Erim" <salih.erim@amd.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v5 3/5] iio: adc: versal-sysmon: add I2C driver
Date: Mon, 08 Jun 2026 18:52:12 +0000 [thread overview]
Message-ID: <20260608185213.2D3D11F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260608183801.1257051-4-salih.erim@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Unconditional probe failure for I2C devices due to incorrect handling of optional IRQ.
--
commit f3303ed1c4a2a87b882fc5ca294a42e9cb520b70
Author: Salih Erim <salih.erim@amd.com>
iio: adc: versal-sysmon: add I2C driver
This commit adds an I2C transport driver for the Versal SysMon block, allowing
an external master to read voltage and temperature measurements. It explicitly
omits event support as the I2C path does not have an interrupt line.
> diff --git a/drivers/iio/adc/versal-sysmon-i2c.c b/drivers/iio/adc/versal-sysmon-i2c.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/iio/adc/versal-sysmon-i2c.c
[ ... ]
> +static int sysmon_i2c_probe(struct i2c_client *client)
> +{
> + struct regmap *regmap;
> +
> + regmap = devm_regmap_init(&client->dev, NULL, client,
> + &sysmon_i2c_regmap_config);
> + if (IS_ERR(regmap))
> + return PTR_ERR(regmap);
> +
> + /* I2C has no IRQ connection; events are not supported */
> + return sysmon_core_probe(&client->dev, regmap);
[Severity: High]
Will this unconditionally fail to probe when called from the I2C driver?
Looking at sysmon_core_probe() in versal-sysmon-core.c, it attempts to
get an IRQ and treats any negative return as a fatal error:
int sysmon_core_probe(struct device *dev, struct regmap *regmap)
{
...
irq = fwnode_irq_get(dev_fwnode(dev), 0);
if (irq < 0)
return dev_err_probe(dev, irq, "failed to get IRQ\n");
Since the I2C device tree node lacks an interrupts property, fwnode_irq_get()
will return a negative error code (such as -EINVAL), which causes the probe
to fail entirely before it can successfully initialize the device.
Should the core probe gracefully handle missing optional IRQs so that the
I2C driver can succeed?
> +}
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260608183801.1257051-1-salih.erim@amd.com?part=3
next prev parent reply other threads:[~2026-06-08 18:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-08 18:37 [PATCH v5 0/5] iio: adc: add AMD/Xilinx Versal SysMon driver Salih Erim
2026-06-08 18:37 ` [PATCH v5 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-08 18:37 ` [PATCH v5 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-08 18:37 ` [PATCH v5 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-08 18:52 ` sashiko-bot [this message]
2026-06-08 18:38 ` [PATCH v5 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-08 18:52 ` sashiko-bot
2026-06-08 18:38 ` [PATCH v5 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-08 18:49 ` sashiko-bot
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=20260608185213.2D3D11F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=salih.erim@amd.com \
--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