From: sashiko-bot@kernel.org
To: "John Erasmus Mari Geronimo"
<johnerasmusmari.geronimo@analog.com>,
devicetree@vger.kernel.org
Cc: robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH v7 2/2] iio: temperature: add support for Analog Devices MAX30210
Date: Wed, 25 Nov 2026 03:08:00 +0000 [thread overview]
Message-ID: <sashiko-outbox-232450@kernel.org> (raw)
In-Reply-To: <20261125025425.1176-3-johnerasmusmari.geronimo@analog.com>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] iio: temperature: max30210: stale status bits trigger
spurious IRQs
--
commit 2a3214dc2717ef12f1999e87ec7c0d52ca73b003
Author: John Erasmus Mari Geronimo <johnerasmusmari.geronimo@analog.com>
iio: temperature: add support for Analog Devices MAX30210
This commit adds an IIO driver for the Analog Devices MAX30210 I2C
temperature sensor with support for direct reads, threshold events, and
a 64-sample hardware FIFO buffer.
> diff --git a/drivers/iio/temperature/max30210.c b/drivers/iio/temperature/max30210.c
> new file mode 100644
> index 0000000000000..5f704bf9a8480
> --- /dev/null
> +++ b/drivers/iio/temperature/max30210.c
[ ... ]
> +/* The core calls this after hwfifo_set_watermark(), so the watermark is stable here. */
> +static int max30210_buffer_postenable(struct iio_dev *indio_dev)
> +{
> + struct max30210_state *st = iio_priv(indio_dev);
> + unsigned int status;
> + int ret;
> +
> + guard(mutex)(&st->lock);
> +
> + /*
> + * Clear a stale A_FULL so it cannot fire on the flushed FIFO. With
> + * no autoconv user no threshold event is armed, so STATUS holds
> + * nothing worth keeping; otherwise leave it for the IRQ handler.
> + */
> + if (!st->autoconv_users) {
> + ret = regmap_read(st->regmap, MAX30210_STATUS_REG, &status);
> + if (ret)
> + return ret;
> + }
> +
> + ret = max30210_autoconv_get(st);
> + if (ret)
> + return ret;
> +
> + ret = regmap_set_bits(st->regmap, MAX30210_INT_EN_REG,
> + MAX30210_STATUS_A_FULL_MASK);
[Severity: Medium]
Does skipping the MAX30210_STATUS_REG read when st->autoconv_users is
non-zero leave a stale MAX30210_STATUS_A_FULL_MASK bit latched?
When a threshold event is enabled first, autonomous conversions run with
MAX30210_STATUS_A_FULL_MASK masked in MAX30210_INT_EN_REG, filling the
unmonitored FIFO until A_FULL latches in MAX30210_STATUS_REG. When the
buffer is then enabled, max30210_buffer_preenable() flushes the FIFO
without clearing MAX30210_STATUS_REG, and unmasking
MAX30210_STATUS_A_FULL_MASK here immediately fires an interrupt that
calls max30210_fifo_read() on the empty FIFO.
Similarly, max30210_write_event_config() enables
MAX30210_STATUS_TEMP_HI_MASK or MAX30210_STATUS_TEMP_LO_MASK in
MAX30210_INT_EN_REG without clearing stale threshold bits latched in
MAX30210_STATUS_REG during earlier conversions, which immediately pushes
a spurious threshold event.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261125025425.1176-1-johnerasmusmari.geronimo@analog.com?part=2
next prev parent reply other threads:[~2026-11-25 3:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 2:54 [PATCH v7 0/2] Add support for Analog Devices MAX30210 John Erasmus Mari Geronimo
2026-11-25 2:54 ` [PATCH v7 1/2] dt-bindings: iio: temperature: add ADI MAX30210 John Erasmus Mari Geronimo
2026-11-25 2:54 ` [PATCH v7 2/2] iio: temperature: add support for Analog Devices MAX30210 John Erasmus Mari Geronimo
2026-11-25 3:08 ` sashiko-bot [this message]
2026-11-29 1:16 ` Jonathan Cameron
2026-11-25 3:08 ` [PATCH v7 0/2] Add " sashiko-bot
2026-11-29 1:06 ` 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=sashiko-outbox-232450@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=johnerasmusmari.geronimo@analog.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.