aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-10-13 14:49:38 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-10-13 14:49:38 -0400
commit997301a860fca1a05ab8e383a8039b65f8abeb1e (patch)
tree43f7824db4ae0123278bd8cb0e5b09cc36af025e
parent0c080ceee7e15a371a05c8c8c4b4dda2fa03209f (diff)
parentce76353f169a6471542d999baf3d29b121dce9c0 (diff)
Merge tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU fixes from Joerg Roedel: - keep an important data structure in the Exynos driver around after kernel-init to fix a kernel-oops - keep SWIOTLB enabled when SME is active in the AMD IOMMU driver - add a missing IOTLB sync to the AMD IOMMU driver * tag 'iommu-fixes-v4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: iommu/amd: Finish TLB flush in amd_iommu_unmap() iommu/exynos: Remove initconst attribute to avoid potential kernel oops iommu/amd: Do not disable SWIOTLB if SME is active
-rw-r--r--drivers/iommu/amd_iommu.c11
-rw-r--r--drivers/iommu/exynos-iommu.c2
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 51f8215877f5..8e8874d23717 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2773,14 +2773,16 @@ int __init amd_iommu_init_api(void)
2773 2773
2774int __init amd_iommu_init_dma_ops(void) 2774int __init amd_iommu_init_dma_ops(void)
2775{ 2775{
2776 swiotlb = iommu_pass_through ? 1 : 0; 2776 swiotlb = (iommu_pass_through || sme_me_mask) ? 1 : 0;
2777 iommu_detected = 1; 2777 iommu_detected = 1;
2778 2778
2779 /* 2779 /*
2780 * In case we don't initialize SWIOTLB (actually the common case 2780 * In case we don't initialize SWIOTLB (actually the common case
2781 * when AMD IOMMU is enabled), make sure there are global 2781 * when AMD IOMMU is enabled and SME is not active), make sure there
2782 * dma_ops set as a fall-back for devices not handled by this 2782 * are global dma_ops set as a fall-back for devices not handled by
2783 * driver (for example non-PCI devices). 2783 * this driver (for example non-PCI devices). When SME is active,
2784 * make sure that swiotlb variable remains set so the global dma_ops
2785 * continue to be SWIOTLB.
2784 */ 2786 */
2785 if (!swiotlb) 2787 if (!swiotlb)
2786 dma_ops = &nommu_dma_ops; 2788 dma_ops = &nommu_dma_ops;
@@ -3046,6 +3048,7 @@ static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova,
3046 mutex_unlock(&domain->api_lock); 3048 mutex_unlock(&domain->api_lock);
3047 3049
3048 domain_flush_tlb_pde(domain); 3050 domain_flush_tlb_pde(domain);
3051 domain_flush_complete(domain);
3049 3052
3050 return unmap_size; 3053 return unmap_size;
3051} 3054}
diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index f596fcc32898..25c2c75f5332 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -709,7 +709,7 @@ static const struct dev_pm_ops sysmmu_pm_ops = {
709 pm_runtime_force_resume) 709 pm_runtime_force_resume)
710}; 710};
711 711
712static const struct of_device_id sysmmu_of_match[] __initconst = { 712static const struct of_device_id sysmmu_of_match[] = {
713 { .compatible = "samsung,exynos-sysmmu", }, 713 { .compatible = "samsung,exynos-sysmmu", },
714 { }, 714 { },
715}; 715};