aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c11
-rw-r--r--drivers/iommu/amd_iommu_init.c6
-rw-r--r--drivers/iommu/amd_iommu_types.h2
-rw-r--r--drivers/iommu/tegra-smmu.c4
4 files changed, 16 insertions, 7 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index a2e418cba0ff..625626391f2d 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -83,6 +83,8 @@ static struct iommu_ops amd_iommu_ops;
83static ATOMIC_NOTIFIER_HEAD(ppr_notifier); 83static ATOMIC_NOTIFIER_HEAD(ppr_notifier);
84int amd_iommu_max_glx_val = -1; 84int amd_iommu_max_glx_val = -1;
85 85
86static struct dma_map_ops amd_iommu_dma_ops;
87
86/* 88/*
87 * general struct to manage commands send to an IOMMU 89 * general struct to manage commands send to an IOMMU
88 */ 90 */
@@ -402,7 +404,7 @@ static void amd_iommu_stats_init(void)
402 return; 404 return;
403 405
404 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir, 406 de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
405 (u32 *)&amd_iommu_unmap_flush); 407 &amd_iommu_unmap_flush);
406 408
407 amd_iommu_stats_add(&compl_wait); 409 amd_iommu_stats_add(&compl_wait);
408 amd_iommu_stats_add(&cnt_map_single); 410 amd_iommu_stats_add(&cnt_map_single);
@@ -2267,6 +2269,13 @@ static int device_change_notifier(struct notifier_block *nb,
2267 list_add_tail(&dma_domain->list, &iommu_pd_list); 2269 list_add_tail(&dma_domain->list, &iommu_pd_list);
2268 spin_unlock_irqrestore(&iommu_pd_list_lock, flags); 2270 spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
2269 2271
2272 dev_data = get_dev_data(dev);
2273
2274 if (!dev_data->passthrough)
2275 dev->archdata.dma_ops = &amd_iommu_dma_ops;
2276 else
2277 dev->archdata.dma_ops = &nommu_dma_ops;
2278
2270 break; 2279 break;
2271 case BUS_NOTIFY_DEL_DEVICE: 2280 case BUS_NOTIFY_DEL_DEVICE:
2272 2281
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 542024ba6dba..a33612f3206f 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -129,7 +129,7 @@ u16 amd_iommu_last_bdf; /* largest PCI device id we have
129 to handle */ 129 to handle */
130LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings 130LIST_HEAD(amd_iommu_unity_map); /* a list of required unity mappings
131 we find in ACPI */ 131 we find in ACPI */
132bool amd_iommu_unmap_flush; /* if true, flush on every unmap */ 132u32 amd_iommu_unmap_flush; /* if true, flush on every unmap */
133 133
134LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the 134LIST_HEAD(amd_iommu_list); /* list of all AMD IOMMUs in the
135 system */ 135 system */
@@ -1641,6 +1641,8 @@ static int __init amd_iommu_init(void)
1641 1641
1642 amd_iommu_init_api(); 1642 amd_iommu_init_api();
1643 1643
1644 x86_platform.iommu_shutdown = disable_iommus;
1645
1644 if (iommu_pass_through) 1646 if (iommu_pass_through)
1645 goto out; 1647 goto out;
1646 1648
@@ -1649,8 +1651,6 @@ static int __init amd_iommu_init(void)
1649 else 1651 else
1650 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n"); 1652 printk(KERN_INFO "AMD-Vi: Lazy IO/TLB flushing enabled\n");
1651 1653
1652 x86_platform.iommu_shutdown = disable_iommus;
1653
1654out: 1654out:
1655 return ret; 1655 return ret;
1656 1656
diff --git a/drivers/iommu/amd_iommu_types.h b/drivers/iommu/amd_iommu_types.h
index 24355559a2ad..c1b1d489817e 100644
--- a/drivers/iommu/amd_iommu_types.h
+++ b/drivers/iommu/amd_iommu_types.h
@@ -652,7 +652,7 @@ extern unsigned long *amd_iommu_pd_alloc_bitmap;
652 * If true, the addresses will be flushed on unmap time, not when 652 * If true, the addresses will be flushed on unmap time, not when
653 * they are reused 653 * they are reused
654 */ 654 */
655extern bool amd_iommu_unmap_flush; 655extern u32 amd_iommu_unmap_flush;
656 656
657/* Smallest number of PASIDs supported by any IOMMU in the system */ 657/* Smallest number of PASIDs supported by any IOMMU in the system */
658extern u32 amd_iommu_max_pasids; 658extern u32 amd_iommu_max_pasids;
diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
index ecd679043d77..3f3d09d560ea 100644
--- a/drivers/iommu/tegra-smmu.c
+++ b/drivers/iommu/tegra-smmu.c
@@ -550,13 +550,13 @@ static int alloc_pdir(struct smmu_as *as)
550 return 0; 550 return 0;
551 551
552 as->pte_count = devm_kzalloc(smmu->dev, 552 as->pte_count = devm_kzalloc(smmu->dev,
553 sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_KERNEL); 553 sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_ATOMIC);
554 if (!as->pte_count) { 554 if (!as->pte_count) {
555 dev_err(smmu->dev, 555 dev_err(smmu->dev,
556 "failed to allocate smmu_device PTE cunters\n"); 556 "failed to allocate smmu_device PTE cunters\n");
557 return -ENOMEM; 557 return -ENOMEM;
558 } 558 }
559 as->pdir_page = alloc_page(GFP_KERNEL | __GFP_DMA); 559 as->pdir_page = alloc_page(GFP_ATOMIC | __GFP_DMA);
560 if (!as->pdir_page) { 560 if (!as->pdir_page) {
561 dev_err(smmu->dev, 561 dev_err(smmu->dev,
562 "failed to allocate smmu_device page directory\n"); 562 "failed to allocate smmu_device page directory\n");