diff options
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/arm-smmu.c | 9 | ||||
-rw-r--r-- | drivers/iommu/intel-iommu.c | 7 | ||||
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 1 |
3 files changed, 10 insertions, 7 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index fc13dd56953e..a3adde6519f0 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -1288,10 +1288,13 @@ static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain, | |||
1288 | return 0; | 1288 | return 0; |
1289 | 1289 | ||
1290 | spin_lock_irqsave(&smmu_domain->pgtbl_lock, flags); | 1290 | spin_lock_irqsave(&smmu_domain->pgtbl_lock, flags); |
1291 | if (smmu_domain->smmu->features & ARM_SMMU_FEAT_TRANS_OPS) | 1291 | if (smmu_domain->smmu->features & ARM_SMMU_FEAT_TRANS_OPS && |
1292 | smmu_domain->stage == ARM_SMMU_DOMAIN_S1) { | ||
1292 | ret = arm_smmu_iova_to_phys_hard(domain, iova); | 1293 | ret = arm_smmu_iova_to_phys_hard(domain, iova); |
1293 | else | 1294 | } else { |
1294 | ret = ops->iova_to_phys(ops, iova); | 1295 | ret = ops->iova_to_phys(ops, iova); |
1296 | } | ||
1297 | |||
1295 | spin_unlock_irqrestore(&smmu_domain->pgtbl_lock, flags); | 1298 | spin_unlock_irqrestore(&smmu_domain->pgtbl_lock, flags); |
1296 | 1299 | ||
1297 | return ret; | 1300 | return ret; |
@@ -1556,7 +1559,7 @@ static int arm_smmu_device_cfg_probe(struct arm_smmu_device *smmu) | |||
1556 | return -ENODEV; | 1559 | return -ENODEV; |
1557 | } | 1560 | } |
1558 | 1561 | ||
1559 | if (smmu->version == 1 || (!(id & ID0_ATOSNS) && (id & ID0_S1TS))) { | 1562 | if ((id & ID0_S1TS) && ((smmu->version == 1) || (id & ID0_ATOSNS))) { |
1560 | smmu->features |= ARM_SMMU_FEAT_TRANS_OPS; | 1563 | smmu->features |= ARM_SMMU_FEAT_TRANS_OPS; |
1561 | dev_notice(smmu->dev, "\taddress translation ops\n"); | 1564 | dev_notice(smmu->dev, "\taddress translation ops\n"); |
1562 | } | 1565 | } |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index ae4c1a854e57..2d1e05bdbb53 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -1742,9 +1742,8 @@ static int domain_init(struct dmar_domain *domain, int guest_width) | |||
1742 | 1742 | ||
1743 | static void domain_exit(struct dmar_domain *domain) | 1743 | static void domain_exit(struct dmar_domain *domain) |
1744 | { | 1744 | { |
1745 | struct dmar_drhd_unit *drhd; | ||
1746 | struct intel_iommu *iommu; | ||
1747 | struct page *freelist = NULL; | 1745 | struct page *freelist = NULL; |
1746 | int i; | ||
1748 | 1747 | ||
1749 | /* Domain 0 is reserved, so dont process it */ | 1748 | /* Domain 0 is reserved, so dont process it */ |
1750 | if (!domain) | 1749 | if (!domain) |
@@ -1764,8 +1763,8 @@ static void domain_exit(struct dmar_domain *domain) | |||
1764 | 1763 | ||
1765 | /* clear attached or cached domains */ | 1764 | /* clear attached or cached domains */ |
1766 | rcu_read_lock(); | 1765 | rcu_read_lock(); |
1767 | for_each_active_iommu(iommu, drhd) | 1766 | for_each_set_bit(i, domain->iommu_bmp, g_num_of_iommus) |
1768 | iommu_detach_domain(domain, iommu); | 1767 | iommu_detach_domain(domain, g_iommus[i]); |
1769 | rcu_read_unlock(); | 1768 | rcu_read_unlock(); |
1770 | 1769 | ||
1771 | dma_free_pagelist(freelist); | 1770 | dma_free_pagelist(freelist); |
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 10186cac7716..bc39bdf7b99b 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c | |||
@@ -851,6 +851,7 @@ static int ipmmu_remove(struct platform_device *pdev) | |||
851 | 851 | ||
852 | static const struct of_device_id ipmmu_of_ids[] = { | 852 | static const struct of_device_id ipmmu_of_ids[] = { |
853 | { .compatible = "renesas,ipmmu-vmsa", }, | 853 | { .compatible = "renesas,ipmmu-vmsa", }, |
854 | { } | ||
854 | }; | 855 | }; |
855 | 856 | ||
856 | static struct platform_driver ipmmu_driver = { | 857 | static struct platform_driver ipmmu_driver = { |