From: sashiko-bot@kernel.org
To: "Esben Haabendal" <esben@geanix.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v10 05/10] iio: accel: mma8452: Only apply trigger type when not set by firmware
Date: Mon, 28 Sep 2026 08:36:59 +0000 [thread overview]
Message-ID: <20260928083700.4F9ED1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260928-mma8452-open-drain-v10-5-b906fb408386@geanix.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] iio: accel: mma8452: IRQ storm due to unconfigured hardware interrupt polarity
--
commit 24f5b1347bb4e1832201e80435a781ee363c54e3
Author: Esben Haabendal <esben@geanix.com>
iio: accel: mma8452: Only apply trigger type when not set by firmware
This commit changes the mma8452 probe function to read the IRQ trigger type
from the firmware instead of unconditionally forcing it to active-low. It
falls back to active-low if the firmware does not specify a type.
> 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]
Does this risk an IRQ storm if the firmware specifies an active-high trigger?
By dynamically applying the firmware's IRQ trigger type to the host interrupt
controller, the host configuration might no longer match the hardware default.
If the firmware requests an active-high interrupt, the host interrupt
controller will be configured for it here. However, the driver does not appear
to write to the MMA8452 sensor's CTRL_REG3 register to set the IPOL bit. This
leaves the sensor's physical output polarity at its active-low default.
For a level-triggered interrupt, this mismatch would cause the interrupt line
to constantly fire. Since the interrupt handler returns IRQ_NONE when no events
are pending, could this result in an infinite loop?
> if (ret)
> goto buffer_cleanup;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260928-mma8452-open-drain-v10-0-b906fb408386@geanix.com?part=5
next prev parent reply other threads:[~2026-09-28 8:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-28 8:26 [PATCH v10 00/10] io: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 01/10] dt-bindings: iio: accel: mma8452: Add drive-open-drain Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 02/10] iio: accel: mma8452: Fix use-after-free bug in error error path Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 03/10] iio: accel: mma8452: Fix runtime PM bugs in mma8452_read() Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 04/10] iio: accel: mma8452: Optimize struct mma8452_data member orders Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 05/10] iio: accel: mma8452: Only apply trigger type when not set by firmware Esben Haabendal
2026-09-28 8:36 ` sashiko-bot [this message]
2026-09-28 8:26 ` [PATCH v10 06/10] iio: accel: mma8452: Fix unintended comment indent Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 07/10] iio: accel: mma8452: Add comment block for struct mma8452_data Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 08/10] iio: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 09/10] iio: accel: mma8452: Use proper error code when missing device model Esben Haabendal
2026-09-28 8:26 ` [PATCH v10 10/10] iio: accel: mma8452: Support interrupt sharing Esben Haabendal
2026-09-28 8:43 ` sashiko-bot
2026-09-28 9:26 ` Andy Shevchenko
2026-09-28 10:15 ` Esben Haabendal
2026-09-28 10:17 ` Esben Haabendal
2026-09-28 10:27 ` Joshua Crofts
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=20260928083700.4F9ED1F000FF@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