From: sashiko-bot@kernel.org
To: "Esben Haabendal" <esben@geanix.com>
Cc: conor+dt@kernel.org, devicetree@vger.kernel.org, robh@kernel.org
Subject: Re: [PATCH v8 7/9] iio: accel: mma8452: Allow open drain interrupt pin configuration
Date: Mon, 07 Sep 2026 15:05:35 +0000 [thread overview]
Message-ID: <20260907150535.9331B1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907-mma8452-open-drain-v8-7-c17407e22118@geanix.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Hardware configuration context is lost across runtime suspend/resume cycles involving power loss.
- [High] Raw reads fail when the device is idle due to waiting for data ready before resuming the device.
--
commit 74793c7cf1159fd96130d4ae4c8de1b7780ff4b3
Author: Esben Haabendal <esben@geanix.com>
iio: accel: mma8452: Allow open drain interrupt pin configuration
When designing systems sharing the interrupt for mma8452 chips, it is
helpful to be able to configure the irq pin in open-drain mode (default is
push-pull).
> diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c
> index 2c1b97b77bc19..b5ab85a86e72a 100644
> --- a/drivers/iio/accel/mma8452.c
> +++ b/drivers/iio/accel/mma8452.c
[ ... ]
> @@ -1792,6 +1816,10 @@ static int mma8452_runtime_resume(struct device *dev)
> return ret;
> }
>
> + ret = mma8452_set_interrupt_pin_mode(data);
> + if (ret)
> + goto runtime_resume_failed;
> +
> ret = mma8452_active(data);
[Severity: High]
This isn't a bug introduced by this patch, but does mma8452_runtime_resume()
fail to restore the hardware configuration after regulators are turned off
during suspend?
The device autosuspends after 2 seconds of inactivity, which disables the
VDD/VDDIO regulators via regulator_bulk_disable(). When it resumes,
mma8452_runtime_resume() appears to only restore CTRL_REG1 (via
mma8452_active()), and now CTRL_REG3, permanently dropping the rest of the
configuration.
Will the sensor lose settings like full-scale range (DATA_CFG), interrupt
routing (CTRL_REG5), and threshold configurations (TRANSIENT_THS) since
they revert to factory defaults upon power loss?
[ ... ]
While reviewing this driver, I noticed another pre-existing issue:
drivers/iio/accel/mma8452.c:mma8452_read() {
...
int ret = mma8452_drdy(data);
if (ret < 0)
return ret;
ret = mma8452_set_runtime_pm_state(data->client, true);
...
}
[Severity: High]
This is a pre-existing issue, but will raw sysfs reads fail when the device
is idle?
The mma8452_set_runtime_pm_state() call to wake the device is placed after
the polling loop for data ready in mma8452_drdy().
If the device has been idle for 2 seconds and entered autosuspend, the
chip is in STANDBY (or completely unpowered). Because of this, the Data
Ready (DRDY) bit is never set. The function times out after polling and
aborts the read before it ever attempts to wake up the device.
Should the device be resumed before polling for data ready?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907-mma8452-open-drain-v8-0-c17407e22118@geanix.com?part=7
next prev parent reply other threads:[~2026-09-07 15:05 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-07 14:50 [PATCH v8 0/9] io: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-07 14:50 ` [PATCH v8 1/9] dt-bindings: iio: accel: mma8452: Add drive-open-drain Esben Haabendal
2026-09-07 14:50 ` [PATCH v8 2/9] iio: accel: mma8452: Fix use-after-free bug in error error path Esben Haabendal
2026-09-07 15:04 ` sashiko-bot
2026-09-07 15:08 ` Esben Haabendal
2026-09-07 14:50 ` [PATCH v8 3/9] iio: accel: mma8452: Optimize struct mma8452_data member orders Esben Haabendal
2026-09-07 14:50 ` [PATCH v8 4/9] iio: accel: mma8452: Only apply trigger type when not set by firmware Esben Haabendal
2026-09-07 15:01 ` sashiko-bot
2026-09-07 14:51 ` [PATCH v8 5/9] iio: accel: mma8452: Fix unintended comment indent Esben Haabendal
2026-09-07 15:04 ` Joshua Crofts
2026-09-07 14:51 ` [PATCH v8 6/9] iio: accel: mma8452: Add comment block for struct mma8452_data Esben Haabendal
2026-09-07 14:58 ` sashiko-bot
2026-09-07 15:07 ` Esben Haabendal
2026-09-07 15:14 ` Joshua Crofts
2026-09-07 16:28 ` Esben Haabendal
2026-09-08 10:36 ` Andy Shevchenko
2026-09-07 14:51 ` [PATCH v8 7/9] iio: accel: mma8452: Allow open drain interrupt pin configuration Esben Haabendal
2026-09-07 15:05 ` sashiko-bot [this message]
2026-09-07 15:09 ` Esben Haabendal
2026-09-07 14:51 ` [PATCH v8 8/9] iio: accel: mma8452: Use proper error code when missing device model Esben Haabendal
2026-09-07 14:51 ` [PATCH v8 9/9] iio: accel: mma8452: Support interrupt sharing Esben Haabendal
2026-09-07 15:08 ` sashiko-bot
2026-09-07 15:58 ` Esben Haabendal
2026-09-08 9:15 ` Esben Haabendal
2026-09-07 15:10 ` Joshua Crofts
2026-09-07 16:36 ` Esben Haabendal
2026-09-09 9:21 ` 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=20260907150535.9331B1F00A3A@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 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.