Skip to content

Commit d290805

Browse files
marcanjannau
authored andcommitted
iommu: apple-dart: Clear stream error indicator bits for T8110 DARTs
These registers exist at least on the t602x variant, and if not cleared the IRQ will never clear. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent d39d372 commit d290805

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@
123123
#define DART_T8110_ERROR_ADDR_LO 0x170
124124
#define DART_T8110_ERROR_ADDR_HI 0x174
125125

126+
#define DART_T8110_ERROR_STREAMS 0x1c0
127+
126128
#define DART_T8110_PROTECT 0x200
127129
#define DART_T8110_UNPROTECT 0x204
128130
#define DART_T8110_PROTECT_LOCK 0x208
@@ -1221,6 +1223,7 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
12211223
u32 addr_hi = readl(dart->regs + DART_T8110_ERROR_ADDR_HI);
12221224
u64 addr = addr_lo | (((u64)addr_hi) << 32);
12231225
u8 stream_idx = FIELD_GET(DART_T8110_ERROR_STREAM, error);
1226+
int i;
12241227

12251228
if (!(error & DART_T8110_ERROR_FLAG))
12261229
return IRQ_NONE;
@@ -1247,6 +1250,9 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
12471250
error, stream_idx, error_code, fault_name, addr);
12481251

12491252
writel(error, dart->regs + DART_T8110_ERROR);
1253+
for (i = 0; i < BITS_TO_U32(dart->num_streams); i++)
1254+
writel(U32_MAX, dart->regs + DART_T8110_ERROR_STREAMS + 4 * i);
1255+
12501256
return IRQ_HANDLED;
12511257
}
12521258

0 commit comments

Comments
 (0)