diff options
-rw-r--r-- | drivers/iommu/intel-iommu.c | 12 | ||||
-rw-r--r-- | drivers/iommu/ipmmu-vmsa.c | 6 | ||||
-rw-r--r-- | drivers/iommu/rockchip-iommu.c | 1 |
3 files changed, 7 insertions, 12 deletions
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 1232336b960e..40dfbc0444c0 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -4029,14 +4029,6 @@ static int device_notifier(struct notifier_block *nb, | |||
4029 | if (action != BUS_NOTIFY_REMOVED_DEVICE) | 4029 | if (action != BUS_NOTIFY_REMOVED_DEVICE) |
4030 | return 0; | 4030 | return 0; |
4031 | 4031 | ||
4032 | /* | ||
4033 | * If the device is still attached to a device driver we can't | ||
4034 | * tear down the domain yet as DMA mappings may still be in use. | ||
4035 | * Wait for the BUS_NOTIFY_UNBOUND_DRIVER event to do that. | ||
4036 | */ | ||
4037 | if (action == BUS_NOTIFY_DEL_DEVICE && dev->driver != NULL) | ||
4038 | return 0; | ||
4039 | |||
4040 | domain = find_domain(dev); | 4032 | domain = find_domain(dev); |
4041 | if (!domain) | 4033 | if (!domain) |
4042 | return 0; | 4034 | return 0; |
@@ -4428,6 +4420,10 @@ static int intel_iommu_attach_device(struct iommu_domain *domain, | |||
4428 | domain_remove_one_dev_info(old_domain, dev); | 4420 | domain_remove_one_dev_info(old_domain, dev); |
4429 | else | 4421 | else |
4430 | domain_remove_dev_info(old_domain); | 4422 | domain_remove_dev_info(old_domain); |
4423 | |||
4424 | if (!domain_type_is_vm_or_si(old_domain) && | ||
4425 | list_empty(&old_domain->devices)) | ||
4426 | domain_exit(old_domain); | ||
4431 | } | 4427 | } |
4432 | } | 4428 | } |
4433 | 4429 | ||
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 68dfb0fd5ee9..748693192c20 100644 --- a/drivers/iommu/ipmmu-vmsa.c +++ b/drivers/iommu/ipmmu-vmsa.c | |||
@@ -558,7 +558,7 @@ static pmd_t *ipmmu_alloc_pmd(struct ipmmu_vmsa_device *mmu, pgd_t *pgd, | |||
558 | 558 | ||
559 | static u64 ipmmu_page_prot(unsigned int prot, u64 type) | 559 | static u64 ipmmu_page_prot(unsigned int prot, u64 type) |
560 | { | 560 | { |
561 | u64 pgprot = ARM_VMSA_PTE_XN | ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF | 561 | u64 pgprot = ARM_VMSA_PTE_nG | ARM_VMSA_PTE_AF |
562 | | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV | 562 | | ARM_VMSA_PTE_SH_IS | ARM_VMSA_PTE_AP_UNPRIV |
563 | | ARM_VMSA_PTE_NS | type; | 563 | | ARM_VMSA_PTE_NS | type; |
564 | 564 | ||
@@ -568,8 +568,8 @@ static u64 ipmmu_page_prot(unsigned int prot, u64 type) | |||
568 | if (prot & IOMMU_CACHE) | 568 | if (prot & IOMMU_CACHE) |
569 | pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT; | 569 | pgprot |= IMMAIR_ATTR_IDX_WBRWA << ARM_VMSA_PTE_ATTRINDX_SHIFT; |
570 | 570 | ||
571 | if (prot & IOMMU_EXEC) | 571 | if (prot & IOMMU_NOEXEC) |
572 | pgprot &= ~ARM_VMSA_PTE_XN; | 572 | pgprot |= ARM_VMSA_PTE_XN; |
573 | else if (!(prot & (IOMMU_READ | IOMMU_WRITE))) | 573 | else if (!(prot & (IOMMU_READ | IOMMU_WRITE))) |
574 | /* If no access create a faulting entry to avoid TLB fills. */ | 574 | /* If no access create a faulting entry to avoid TLB fills. */ |
575 | pgprot &= ~ARM_VMSA_PTE_PAGE; | 575 | pgprot &= ~ARM_VMSA_PTE_PAGE; |
diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index b2023af384b9..6a8b1ec4a48a 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c | |||
@@ -1009,7 +1009,6 @@ static struct platform_driver rk_iommu_driver = { | |||
1009 | .remove = rk_iommu_remove, | 1009 | .remove = rk_iommu_remove, |
1010 | .driver = { | 1010 | .driver = { |
1011 | .name = "rk_iommu", | 1011 | .name = "rk_iommu", |
1012 | .owner = THIS_MODULE, | ||
1013 | .of_match_table = of_match_ptr(rk_iommu_dt_ids), | 1012 | .of_match_table = of_match_ptr(rk_iommu_dt_ids), |
1014 | }, | 1013 | }, |
1015 | }; | 1014 | }; |