From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Hector Martin <marcan@marcan.st>, Janne Grunau <j@jannau.net>,
Sven Peter <sven@kernel.org>, Neal Gompa <neal@gompa.dev>,
Joerg Roedel <joerg.roedel@amd.com>,
Sasha Levin <sashal@kernel.org>,
joro@8bytes.org, will@kernel.org, asahi@lists.linux.dev,
linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev
Subject: [PATCH AUTOSEL 6.17-6.6] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
Date: Sat, 25 Oct 2025 11:59:52 -0400 [thread overview]
Message-ID: <20251025160905.3857885-361-sashal@kernel.org> (raw)
In-Reply-To: <20251025160905.3857885-1-sashal@kernel.org>
From: Hector Martin <marcan@marcan.st>
[ Upstream commit ecf6508923f87e4597228f70cc838af3d37f6662 ]
These registers exist and at least on the t602x variant the IRQ only
clears when theses are cleared.
Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Sven Peter <sven@kernel.org>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Link: https://lore.kernel.org/r/20250826-dart-t8110-stream-error-v1-1-e33395112014@jannau.net
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
YES
- Fixes a real bug: On T8110-class DARTs, the interrupt only deasserts
when per‑stream error indicator bits are cleared. Without clearing
them, the IRQ can remain asserted, causing repeated interrupts and
potential system instability.
- Minimal, contained change: Adds one register define and a short clear
loop in the T8110 IRQ handler only.
- Adds `DART_T8110_ERROR_STREAMS` at `0x1c0` (drivers/iommu/apple-
dart.c:125).
- In `apple_dart_t8110_irq`, after acknowledging the error status
(`writel(error, ...)`), clears all stream error indicator words:
`for (int i = 0; i < BITS_TO_U32(dart->num_streams); i++)
writel(U32_MAX, dart->regs + DART_T8110_ERROR_STREAMS + 4 * i);`
(drivers/iommu/apple-dart.c:1093, drivers/iommu/apple-dart.c:1094,
drivers/iommu/apple-dart.c:1095).
- Scoped to T8110 only: The handler is registered only for the T8110
hardware variant (drivers/iommu/apple-dart.c:1298), so it does not
affect other Apple DART generations.
- Safe by design:
- `num_streams` is read from hardware (`DART_T8110_PARAMS4_NUM_SIDS`)
and bounded by `DART_MAX_STREAMS` (drivers/iommu/apple-dart.c:1152,
drivers/iommu/apple-dart.c:1153, drivers/iommu/apple-dart.c:1156,
drivers/iommu/apple-dart.c:1161).
- `BITS_TO_U32(...)` ensures the correct number of 32‑bit words are
cleared.
- The driver already uses the same write‑all‑ones bitmap pattern for
stream operations (e.g., enabling all streams) showing these
registers are W1C bitmaps and that this access pattern is
established and safe (drivers/iommu/apple-dart.c:485,
drivers/iommu/apple-dart.c:486).
- No architectural changes or API/ABI effects: This is a straightforward
IRQ acknowledgment fix limited to the Apple DART IOMMU driver.
- User impact: Prevents stuck/level interrupts and interrupt floods on
affected Apple SoCs (e.g., t602x using T8110 DART), improving
stability and correctness.
Given it is a clear bug fix, small and localized, with low regression
risk and meaningful user impact, it is a strong candidate for
backporting to stable kernels that include the T8110 DART support.
drivers/iommu/apple-dart.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index 190f28d766151..8b1272b7bb44a 100644
--- a/drivers/iommu/apple-dart.c
+++ b/drivers/iommu/apple-dart.c
@@ -122,6 +122,8 @@
#define DART_T8110_ERROR_ADDR_LO 0x170
#define DART_T8110_ERROR_ADDR_HI 0x174
+#define DART_T8110_ERROR_STREAMS 0x1c0
+
#define DART_T8110_PROTECT 0x200
#define DART_T8110_UNPROTECT 0x204
#define DART_T8110_PROTECT_LOCK 0x208
@@ -1077,6 +1079,9 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
error, stream_idx, error_code, fault_name, addr);
writel(error, dart->regs + DART_T8110_ERROR);
+ for (int i = 0; i < BITS_TO_U32(dart->num_streams); i++)
+ writel(U32_MAX, dart->regs + DART_T8110_ERROR_STREAMS + 4 * i);
+
return IRQ_HANDLED;
}
--
2.51.0
parent reply other threads:[~2025-10-25 16:25 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20251025160905.3857885-1-sashal@kernel.org>]
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=20251025160905.3857885-361-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=asahi@lists.linux.dev \
--cc=iommu@lists.linux.dev \
--cc=j@jannau.net \
--cc=joerg.roedel@amd.com \
--cc=joro@8bytes.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marcan@marcan.st \
--cc=neal@gompa.dev \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=sven@kernel.org \
--cc=will@kernel.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