Skip to content

Commit 3a14d5c

Browse files
alyssarosenzweigmarcan
authored andcommitted
iommu/dart: Allow locked DARTs to probe
Instead of bailing from reset() if the DART is locked, simply skip the reset for locked DARTs. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
1 parent 9ee5d1a commit 3a14d5c

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

drivers/iommu/apple-dart.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -451,17 +451,9 @@ apple_dart_t8110_hw_invalidate_tlb(struct apple_dart_stream_map *stream_map)
451451

452452
static int apple_dart_hw_reset(struct apple_dart *dart)
453453
{
454-
u32 config;
455454
struct apple_dart_stream_map stream_map;
456455
int i;
457456

458-
config = readl(dart->regs + dart->hw->lock);
459-
if (config & dart->hw->lock_bit) {
460-
dev_err(dart->dev, "DART is locked down until reboot: %08x\n",
461-
config);
462-
return -EINVAL;
463-
}
464-
465457
stream_map.dart = dart;
466458
bitmap_zero(stream_map.sidmap, DART_MAX_STREAMS);
467459
bitmap_set(stream_map.sidmap, 0, dart->num_streams);
@@ -1122,9 +1114,11 @@ static int apple_dart_probe(struct platform_device *pdev)
11221114
dart->force_bypass = dart->pgsize > PAGE_SIZE;
11231115

11241116
dart->locked = apple_dart_is_locked(dart);
1125-
ret = apple_dart_hw_reset(dart);
1126-
if (ret)
1127-
goto err_clk_disable;
1117+
if (!dart->locked) {
1118+
ret = apple_dart_hw_reset(dart);
1119+
if (ret)
1120+
goto err_clk_disable;
1121+
}
11281122

11291123
ret = request_irq(dart->irq, dart->hw->irq_handler, IRQF_SHARED,
11301124
"apple-dart fault handler", dart);

0 commit comments

Comments
 (0)