From: sashiko-bot@kernel.org
To: "Salih Erim" <salih.erim@amd.com>
Cc: robh@kernel.org, devicetree@vger.kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v8 3/5] iio: adc: versal-sysmon: add I2C driver
Date: Tue, 16 Jun 2026 13:44:24 +0000 [thread overview]
Message-ID: <20260616134426.7A6D01F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260616131559.3029543-4-salih.erim@amd.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] If a device tree specifies an IRQ for the I2C device, the core driver will register a hardirq handler that calls sleeping I2C regmap functions.
--
commit 08d83b16d0694386536f5b4f39bdb131024076df
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. It
creates an I2C regmap backend and delegates to devm_versal_sysmon_core_probe()
to initialize the device.
> diff --git a/drivers/iio/adc/versal-sysmon-i2c.c b/drivers/iio/adc/versal-sysmon-i2c.c
> new file mode 100644
> index 0000000000000..cd8d5846ff9b2
> --- /dev/null
> +++ b/drivers/iio/adc/versal-sysmon-i2c.c
[ ... ]
> +static int sysmon_i2c_probe(struct i2c_client *client)
> +{
> + struct device *dev = &client->dev;
> + struct regmap *regmap;
> +
> + regmap = devm_regmap_init(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 devm_versal_sysmon_core_probe(dev, regmap);
[Severity: High]
If a device tree incorrectly provides an interrupts property for the I2C
node, will devm_versal_sysmon_core_probe() register an interrupt handler?
Looking at devm_versal_sysmon_core_probe() in versal-sysmon-core.c:
irq = fwnode_irq_get(dev_fwnode(dev), 0);
...
if (irq > 0) {
...
ret = sysmon_init_interrupt(sysmon, dev, indio_dev, irq);
If an interrupt is registered, the handler sysmon_iio_irq() will run in
hardirq context, acquire a spinlock, and call regmap_read():
guard(spinlock)(&sysmon->irq_lock);
if (regmap_read(sysmon->regmap, SYSMON_ISR, &isr) || ...
Because the I2C regmap backend uses i2c_master_recv() which can sleep,
won't this trigger a sleeping in atomic context panic?
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260616131559.3029543-1-salih.erim@amd.com?part=3
next prev parent reply other threads:[~2026-06-16 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-16 13:15 [PATCH v8 0/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-16 13:15 ` [PATCH v8 1/5] dt-bindings: iio: adc: add xlnx,versal-sysmon binding Salih Erim
2026-06-16 13:15 ` [PATCH v8 2/5] iio: adc: add Versal SysMon driver Salih Erim
2026-06-16 13:15 ` [PATCH v8 3/5] iio: adc: versal-sysmon: add I2C driver Salih Erim
2026-06-16 13:44 ` sashiko-bot [this message]
2026-06-16 13:15 ` [PATCH v8 4/5] iio: adc: versal-sysmon: add threshold event support Salih Erim
2026-06-16 13:57 ` sashiko-bot
2026-06-16 13:15 ` [PATCH v8 5/5] iio: adc: versal-sysmon: add oversampling support Salih Erim
2026-06-16 14:08 ` 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=20260616134426.7A6D01F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.