[PATCH] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs

Janne Grunau posted 1 patch 1 month, 1 week ago
drivers/iommu/apple-dart.c | 5 +++++
1 file changed, 5 insertions(+)
[PATCH] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
Posted by Janne Grunau 1 month, 1 week ago
From: Hector Martin <marcan@marcan.st>

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>
---
I've overlooked this change for the 4 level page table / t6020 support
series [1]. There are no dependencies to series so this can go in on its
own.

Janne

1: https://lore.kernel.org/asahi/20250821-apple-dart-4levels-v2-0-e39af79daa37@jannau.net/
---
 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 190f28d76615159527649cd288df395a50d950ef..8b1272b7bb44a1ebc03ca4ddf3be43a1e42c97ed 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;
 }
 

---
base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250826-dart-t8110-stream-error-1c2bbbf4fb63

Best regards,
-- 
Janne Grunau <j@jannau.net>
Re: [PATCH] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
Posted by Joerg Roedel 4 weeks ago
On Tue, Aug 26, 2025 at 12:57:18PM +0200, Janne Grunau wrote:
> From: Hector Martin <marcan@marcan.st>
> 
> 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>
> ---
> I've overlooked this change for the 4 level page table / t6020 support
> series [1]. There are no dependencies to series so this can go in on its
> own.
> 
> Janne
> 
> 1: https://lore.kernel.org/asahi/20250821-apple-dart-4levels-v2-0-e39af79daa37@jannau.net/
> ---
>  drivers/iommu/apple-dart.c | 5 +++++
>  1 file changed, 5 insertions(+)

Applied, thanks.
Re: [PATCH] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
Posted by Sven Peter 1 month, 1 week ago
On 26.08.25 12:57, Janne Grunau wrote:
> From: Hector Martin <marcan@marcan.st>
> 
> 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>
Re: [PATCH] iommu/apple-dart: Clear stream error indicator bits for T8110 DARTs
Posted by Neal Gompa 1 month, 1 week ago
On Tue, Aug 26, 2025 at 6:57 AM Janne Grunau <j@jannau.net> wrote:
>
> From: Hector Martin <marcan@marcan.st>
>
> 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>
> ---
> I've overlooked this change for the 4 level page table / t6020 support
> series [1]. There are no dependencies to series so this can go in on its
> own.
>
> Janne
>
> 1: https://lore.kernel.org/asahi/20250821-apple-dart-4levels-v2-0-e39af79daa37@jannau.net/
> ---
>  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 190f28d76615159527649cd288df395a50d950ef..8b1272b7bb44a1ebc03ca4ddf3be43a1e42c97ed 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;
>  }
>
>
> ---
> base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
> change-id: 20250826-dart-t8110-stream-error-1c2bbbf4fb63
>

LGTM.

Reviewed-by: Neal Gompa <neal@gompa.dev>


-- 
真実はいつも一つ!/ Always, there's only one truth!