Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Kyle Hsieh" <kylehsieh1995@gmail.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v6 2/2] iio: adc: ti-ads112c04: Add support for TI ADS112C04
Date: Thu, 20 Aug 2026 07:58:11 +0000	[thread overview]
Message-ID: <20260820075812.65B731F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260820-ti-ads112c04-driver-v6-2-0e8f0aacce9b@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Interrupt storm (hard lockup) if DRDY is configured as level-triggered.
--

--- Patch [2]: [PATCH v6 2/2] iio: adc: ti-ads112c04: Add support for TI ADS112C04 ---
commit 88f1a4a634251e87a5f5b33f385ea979bcaa7f17
Author: Kyle Hsieh <kylehsieh1995@gmail.com>

iio: adc: ti-ads112c04: Add support for TI ADS112C04

Add IIO driver support for the Texas Instruments ADS112C04 (16-bit)
delta-sigma ADCs. The driver implements single-shot conversions, dynamic
parsing of channels, hardware interrupts via the DRDY pin, and per-channel
reference source selection.

> diff --git a/drivers/iio/adc/ti-ads112c04.c b/drivers/iio/adc/ti-ads112c04.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/iio/adc/ti-ads112c04.c
[ ... ]
> +static irqreturn_t ads112c04_irq_handler(int irq, void *private)
> +{
> +	struct iio_dev *indio_dev = private;
> +	struct ads112c04_state *st = iio_priv(indio_dev);
> +
> +	complete(&st->completion);
> +
> +	return IRQ_HANDLED;
> +}
[ ... ]
> +static int ads112c04_probe(struct i2c_client *client)
> +{
[ ... ]
> +	if (client->irq > 0) {
> +		ret = devm_request_irq(dev, client->irq, ads112c04_irq_handler, 0,
> +				       indio_dev->name, indio_dev);

[Severity: High]
Since the hardware DRDY pin stays low until data is read, could an interrupt
storm occur here if the device tree configures the interrupt as
level-triggered?

By passing 0 for the irqflags, the driver accepts the device tree's default
trigger type. If it is set to a level trigger, ads112c04_irq_handler() will
fire, call complete(), and return IRQ_HANDLED without doing any I2C reads to
clear the device-side interrupt.

Because the interrupt source isn't cleared, the interrupt controller will
immediately re-trigger the hardirq. Won't this create an infinite loop that
starves the process context, preventing ads112c04_read_data() from ever
executing to clear the condition?

Should this request enforce an edge trigger, or use a threaded interrupt
handler with IRQF_ONESHOT so the interrupt is masked until the data is read?

> +		if (ret)
> +			return ret;
> +	}
> +
> +	return devm_iio_device_register(dev, indio_dev);
> +}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260820-ti-ads112c04-driver-v6-0-0e8f0aacce9b@gmail.com?part=2

      reply	other threads:[~2026-08-20  7:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20  7:51 [PATCH v6 0/2] iio: adc: Add support for Texas Instruments ADS112C04 Kyle Hsieh
2026-08-20  7:51 ` [PATCH v6 1/2] dt-bindings: iio: adc: ti,ads112c04: Add binding for ADS112C04 Kyle Hsieh
2026-08-20  7:58   ` sashiko-bot
2026-08-20  7:51 ` [PATCH v6 2/2] iio: adc: ti-ads112c04: Add support for TI ADS112C04 Kyle Hsieh
2026-08-20  7:58   ` sashiko-bot [this message]

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=20260820075812.65B731F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kylehsieh1995@gmail.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