Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Esben Haabendal" <esben@geanix.com>
Cc: devicetree@vger.kernel.org, conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v9 05/10] iio: accel: mma8452: Only apply trigger type when not set by firmware
Date: Wed, 16 Sep 2026 08:20:07 +0000	[thread overview]
Message-ID: <20260916082008.13AC51F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260916-mma8452-open-drain-v9-5-0dd24fa2f3d7@geanix.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] iio: accel: mma8452: mismatch between host interrupt config and sensor polarity
--

commit d5f9cc43dbeb055ea3109fb839dcfa1634da10c0
Author: Esben Haabendal <esben@geanix.com>

iio: accel: mma8452: Only apply trigger type when not set by firmware

This commit updates the probe function to use the interrupt trigger type
provided by firmware instead of unconditionally hardcoding it to active-low.
If the firmware does not specify a trigger type, it falls back to the
default active-low configuration.

> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 8d70fe89110cd..72b4ab32775a6 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1669,9 +1669,16 @@ static int mma8452_probe(struct i2c_client *client)
>  		goto trigger_cleanup;
>  
>  	if (client->irq) {
> +		unsigned long irq_flags;
> +
> +		irq_flags = irq_get_trigger_type(client->irq);
> +		if (irq_flags == IRQ_TYPE_NONE) {
> +			dev_info(dev, "invalid irq type, setting default active low\n");
> +			irq_flags = IRQF_TRIGGER_LOW;
> +		}
> +		irq_flags |= IRQF_ONESHOT;
>  		ret = request_threaded_irq(client->irq, NULL, mma8452_interrupt,
> -					   IRQF_TRIGGER_LOW | IRQF_ONESHOT,
> -					   client->name, indio_dev);
> +					   irq_flags, client->name, indio_dev);

[Severity: High]
If the firmware specifies a non-default interrupt polarity such as
active-high, could this result in an interrupt storm?

While this code programs the host interrupt controller with the requested
polarity, does the sensor's hardware polarity also need to be updated? 
The sensor's default active-low configuration means its inactive state is
logic high. If the host controller is configured for active-high, wouldn't 
it constantly trigger on this logic high, return IRQ_NONE from the handler,
and endlessly re-trigger?

Should the sensor's CTRL_REG3 IPOL bit be programmed to match the requested
irq_flags, ensuring the device output aligns with the host controller's
expectations?

>  		if (ret)
>  			goto buffer_cleanup;
>  	}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260916-mma8452-open-drain-v9-0-0dd24fa2f3d7@geanix.com?part=5

  reply	other threads:[~2026-09-16  8:20 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16  8:07 [PATCH v9 00/10] io: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-16  8:07 ` [PATCH v9 01/10] dt-bindings: iio: accel: mma8452: Add drive-open-drain Esben Haabendal
2026-09-16  8:07 ` [PATCH v9 02/10] iio: accel: mma8452: Fix use-after-free bug in error error path Esben Haabendal
2026-09-16  8:07 ` [PATCH v9 03/10] iio: accel: mma8452: Fix runtime PM bugs in mma8452_read() Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 04/10] iio: accel: mma8452: Optimize struct mma8452_data member orders Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 05/10] iio: accel: mma8452: Only apply trigger type when not set by firmware Esben Haabendal
2026-09-16  8:20   ` sashiko-bot [this message]
2026-09-16  8:08 ` [PATCH v9 06/10] iio: accel: mma8452: Fix unintended comment indent Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 07/10] iio: accel: mma8452: Add comment block for struct mma8452_data Esben Haabendal
2026-09-16  8:14   ` sashiko-bot
2026-09-21  0:52   ` Jonathan Cameron
2026-09-21  5:30     ` Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 08/10] iio: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 09/10] iio: accel: mma8452: Use proper error code when missing device model Esben Haabendal
2026-09-16  8:08 ` [PATCH v9 10/10] iio: accel: mma8452: Support interrupt sharing Esben Haabendal
2026-09-16  8:31   ` sashiko-bot
2026-09-17  6:40     ` Esben Haabendal
2026-09-21  0:51       ` Jonathan Cameron
2026-09-21  5:35         ` Esben Haabendal
2026-09-22  0:18           ` 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=20260916082008.13AC51F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=esben@geanix.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