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 v3 3/4] iio: accel: mma8452: Only apply trigger type when not set by firmware
Date: Wed, 05 Aug 2026 07:33:47 +0000 [thread overview]
Message-ID: <20260805073348.60BBD1F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260805-mma8452-open-drain-v3-3-6149f406a409@geanix.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] The driver applies firmware-specified IRQ trigger types without configuring the sensor's polarity to match, breaking active-high interrupt configurations.
--
--- Patch [3]: [PATCH v3 3/4] iio: accel: mma8452: Only apply trigger type when not set by firmware ---
commit 15bd5e2afb9b0b1a0a93c58982fed1331a0ecfe5
Author: Esben Haabendal <esben@geanix.com>
iio: accel: mma8452: Only apply trigger type when not set by firmware
This commit updates the driver to respect the firmware-provided interrupt
trigger type, falling back to an active-low trigger if no type is
specified by the firmware.
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index f645a5c6fd1c2..723ca3d9cb96b 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
> @@ -1683,9 +1683,14 @@ 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)
> + 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 cause an interrupt mismatch if the firmware specifies an
active-high interrupt?
Looking at mma8452_probe, the driver requests the IRQ with the
firmware-specified polarity, but it doesn't seem to program the sensor
hardware to match. The MMA8452 sensor defaults to active-low interrupts
after a software reset.
Because the driver doesn't update the IPOL bit in MMA8452_CTRL_REG3 when an
active-high trigger is requested, the sensor will still drive an active-low
signal. This mismatch between the IRQ controller expectation and hardware
output could lead to missed interrupts or interrupt storms.
> if (ret)
> goto buffer_cleanup;
> }
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260805-mma8452-open-drain-v3-0-6149f406a409@geanix.com?part=3
next prev parent reply other threads:[~2026-08-05 7:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 7:21 [PATCH v3 0/4] io: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-08-05 7:21 ` [PATCH v3 1/4] dt-bindings: iio: accel: mma8452: Add drive-open-drain Esben Haabendal
2026-08-05 7:21 ` [PATCH v3 2/4] iio: accel: mma8452: Optimize struct mm8452_data member orders Esben Haabendal
2026-08-05 7:21 ` [PATCH v3 3/4] iio: accel: mma8452: Only apply trigger type when not set by firmware Esben Haabendal
2026-08-05 7:33 ` sashiko-bot [this message]
2026-08-05 7:21 ` [PATCH v3 4/4] iio: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-08-05 7:41 ` sashiko-bot
2026-08-05 11:55 ` Esben Haabendal
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=20260805073348.60BBD1F00A3D@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