Skip to content

Commit b66ec63

Browse files
marcanjannau
authored andcommitted
iommu: apple-dart: Don't attempt to reset/restore locked DARTs
This can't work, and should not be needed in these cases. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent fd1066b commit b66ec63

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/iommu/apple-dart.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,9 @@ static void apple_dart_remove(struct platform_device *pdev)
11561156
{
11571157
struct apple_dart *dart = platform_get_drvdata(pdev);
11581158

1159-
apple_dart_hw_reset(dart);
1159+
if (!dart->locked)
1160+
apple_dart_hw_reset(dart);
1161+
11601162
free_irq(dart->irq, dart);
11611163

11621164
iommu_device_unregister(&dart->iommu);
@@ -1262,6 +1264,10 @@ static __maybe_unused int apple_dart_resume(struct device *dev)
12621264
unsigned int sid, idx;
12631265
int ret;
12641266

1267+
/* Locked DARTs can't be restored, and they should not need it */
1268+
if (dart->locked)
1269+
return 0;
1270+
12651271
ret = apple_dart_hw_reset(dart);
12661272
if (ret) {
12671273
dev_err(dev, "Failed to reset DART on resume\n");

0 commit comments

Comments
 (0)