Skip to content

Commit 282ab49

Browse files
committed
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 b94ca3c commit 282ab49

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
@@ -1234,7 +1234,9 @@ static int apple_dart_remove(struct platform_device *pdev)
12341234
{
12351235
struct apple_dart *dart = platform_get_drvdata(pdev);
12361236

1237-
apple_dart_hw_reset(dart);
1237+
if (!dart->locked)
1238+
apple_dart_hw_reset(dart);
1239+
12381240
free_irq(dart->irq, dart);
12391241

12401242
iommu_device_unregister(&dart->iommu);
@@ -1342,6 +1344,10 @@ static __maybe_unused int apple_dart_resume(struct device *dev)
13421344
unsigned int sid, idx;
13431345
int ret;
13441346

1347+
/* Locked DARTs can't be restored, and they should not need it */
1348+
if (dart->locked)
1349+
return 0;
1350+
13451351
ret = apple_dart_hw_reset(dart);
13461352
if (ret) {
13471353
dev_err(dev, "Failed to reset DART on resume\n");

0 commit comments

Comments
 (0)