diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index f4d05da2f06c..d0316996279e 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -102,6 +102,7 @@ struct rk_iommu { int num_clocks; bool reset_disabled; bool skip_read; /* rk3126/rk3128 can't read vop iommu registers */ + bool dlr_disable; /* avoid access iommu when runtime ops called */ struct iommu_device iommu; struct list_head node; /* entry in rk_iommu_domain.iommus */ struct iommu_domain *domain; /* domain to which iommu is attached */ @@ -1216,6 +1217,8 @@ static int rk_iommu_probe(struct platform_device *pdev) "rockchip,disable-mmu-reset"); iommu->skip_read = device_property_read_bool(dev, "rockchip,skip-mmu-read"); + iommu->dlr_disable = device_property_read_bool(dev, + "rockchip,disable-device-link-resume"); iommu->num_clocks = ARRAY_SIZE(rk_iommu_clocks); @@ -1335,6 +1338,9 @@ static int __maybe_unused rk_iommu_suspend(struct device *dev) if (!iommu->domain) return 0; + if (iommu->dlr_disable) + return 0; + rk_iommu_disable(iommu); return 0; } @@ -1346,6 +1352,9 @@ static int __maybe_unused rk_iommu_resume(struct device *dev) if (!iommu->domain) return 0; + if (iommu->dlr_disable) + return 0; + return rk_iommu_enable(iommu); }