Skip to content

Commit df293f1

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 fa47e8a commit df293f1

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
@@ -122,6 +122,8 @@
122122
#define DART_T8110_ERROR_ADDR_LO 0x170
123123
#define DART_T8110_ERROR_ADDR_HI 0x174
124124

125+
#define DART_T8110_ERROR_STREAMS 0x1c0
126+
125127
#define DART_T8110_PROTECT 0x200
126128
#define DART_T8110_UNPROTECT 0x204
127129
#define DART_T8110_PROTECT_LOCK 0x208
@@ -1190,6 +1192,7 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
11901192
u32 addr_hi = readl(dart->regs + DART_T8110_ERROR_ADDR_HI);
11911193
u64 addr = addr_lo | (((u64)addr_hi) << 32);
11921194
u8 stream_idx = FIELD_GET(DART_T8110_ERROR_STREAM, error);
1195+
int i;
11931196

11941197
if (!(error & DART_T8110_ERROR_FLAG))
11951198
return IRQ_NONE;
@@ -1216,6 +1219,9 @@ static irqreturn_t apple_dart_t8110_irq(int irq, void *dev)
12161219
error, stream_idx, error_code, fault_name, addr);
12171220

12181221
writel(error, dart->regs + DART_T8110_ERROR);
1222+
for (i = 0; i < BITS_TO_U32(dart->num_streams); i++)
1223+
writel(U32_MAX, dart->regs + DART_T8110_ERROR_STREAMS + 4 * i);
1224+
12191225
return IRQ_HANDLED;
12201226
}
12211227

0 commit comments

Comments
 (0)