From: Antoniu Miclaus <antoniu.miclaus@analog.com>
To: "Antoniu Miclaus" <antoniu.miclaus@analog.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Marcelo Schmitt" <marcelo.schmitt@analog.com>,
"Joshua Crofts" <joshua.crofts1@gmail.com>,
"Radu Sabau" <radu.sabau@analog.com>,
"Salih Erim" <salih.erim@amd.com>,
"Jishnu Prakash" <jishnu.prakash@oss.qualcomm.com>,
"Jakub Szczudlo" <jakubszczudlo40@gmail.com>,
linux-iio@vger.kernel.org, linux@analog.com,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-doc@vger.kernel.org
Subject: [PATCH v2 2/6] iio: adc: ade9000: fix DIPC event never being handled or cleared
Date: Fri, 18 Sep 2026 10:35:31 +0300 [thread overview]
Message-ID: <20260918073537.1572-3-antoniu.miclaus@analog.com> (raw)
In-Reply-To: <20260918073537.1572-1-antoniu.miclaus@analog.com>
The STATUS1 interrupt handler scans the enabled interrupt bits using
ADE9000_ST1_CROSSING_DEPTH as both the bitmap size and the exclusive upper
bound of the for_each_set_bit_from() loop. ADE9000_ST1_CROSSING_DEPTH was
25, so the scan only covered bits 6..24 and never examined bit 25,
ADE9000_ST1_DIPC_BIT (phase C voltage dip).
As a result, when userspace enables the DIPC threshold event and it fires,
the handler neither pushes the IIO event nor sets bit 25 in handled_irq.
Since STATUS1 is write-1-to-clear, the DIPC status bit is never cleared and
the interrupt keeps re-asserting, causing an interrupt storm.
Bump ADE9000_ST1_CROSSING_DEPTH to 26 so the scan includes DIPC.
Fixes: 81de7b4619fc ("iio: adc: add ade9000 support")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v2:
- new patch, found by the sashiko review of v1.
drivers/iio/adc/ade9000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/ade9000.c b/drivers/iio/adc/ade9000.c
index 0f64bfb221da..ce0317766698 100644
--- a/drivers/iio/adc/ade9000.c
+++ b/drivers/iio/adc/ade9000.c
@@ -219,7 +219,7 @@
#define ADE9000_ST1_ERROR2_BIT BIT(30)
#define ADE9000_ST1_ERROR3_BIT BIT(31)
#define ADE9000_ST1_CROSSING_FIRST 6
-#define ADE9000_ST1_CROSSING_DEPTH 25
+#define ADE9000_ST1_CROSSING_DEPTH 26
#define ADE9000_WFB_TRG_DIP_BIT BIT(0)
#define ADE9000_WFB_TRG_SWELL_BIT BIT(1)
--
2.43.0
next prev parent reply other threads:[~2026-09-18 7:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-18 7:35 [PATCH v2 0/6] iio: adc: ade9000: add ADE9430 support Antoniu Miclaus
2026-09-18 7:35 ` [PATCH v2 1/6] iio: adc: ade9000: fix ADE9000 full-scale RMS and PCF codes Antoniu Miclaus
2026-09-18 7:35 ` Antoniu Miclaus [this message]
2026-09-18 7:35 ` [PATCH v2 3/6] dt-bindings: iio: adc: adi,ade9000: add adi,ade9430 compatible Antoniu Miclaus
2026-09-18 7:35 ` [PATCH v2 4/6] iio: adc: ade9000: gate the DICOEFF write behind a chip_info flag Antoniu Miclaus
2026-09-18 7:35 ` [PATCH v2 5/6] iio: adc: ade9000: add support for ADE9430 Antoniu Miclaus
2026-09-18 7:35 ` [PATCH v2 6/6] docs: iio: ade9000: document ADE9430 support Antoniu Miclaus
2026-09-18 15:27 ` [PATCH v2 0/6] iio: adc: ade9000: add " Nuno Sá
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=20260918073537.1572-3-antoniu.miclaus@analog.com \
--to=antoniu.miclaus@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=conor+dt@kernel.org \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=dlechner@baylibre.com \
--cc=jakubszczudlo40@gmail.com \
--cc=jic23@kernel.org \
--cc=jishnu.prakash@oss.qualcomm.com \
--cc=joshua.crofts1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@analog.com \
--cc=marcelo.schmitt@analog.com \
--cc=nuno.sa@analog.com \
--cc=radu.sabau@analog.com \
--cc=rdunlap@infradead.org \
--cc=robh@kernel.org \
--cc=salih.erim@amd.com \
--cc=skhan@linuxfoundation.org \
/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
all inboxes | Powered by JetHome®