summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-22 19:32:00 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-22 19:32:00 +0100
commit3384fb98845dc014770caa224d61a2effd258ca5 (patch)
tree8189134a4938632e2d06e93af04c9fc1f3c2d4c9 /drivers/iommu/amd_iommu.c
parent8cfc545e0e3e6cc82acfdc79321b41eeeab0ca45 (diff)
parentade7515fefad9af13f6dd469f35bb413b6a5b473 (diff)
downloadtalos-op-linux-3384fb98845dc014770caa224d61a2effd258ca5.tar.gz
talos-op-linux-3384fb98845dc014770caa224d61a2effd258ca5.zip
Merge branch 'regulator-drivers' into regulator-next
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c11
1 files changed, 10 insertions, 1 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;
static ATOMIC_NOTIFIER_HEAD(ppr_notifier);
int amd_iommu_max_glx_val = -1;
+static struct dma_map_ops amd_iommu_dma_ops;
+
/*
* general struct to manage commands send to an IOMMU
*/
@@ -402,7 +404,7 @@ static void amd_iommu_stats_init(void)
return;
de_fflush = debugfs_create_bool("fullflush", 0444, stats_dir,
- (u32 *)&amd_iommu_unmap_flush);
+ &amd_iommu_unmap_flush);
amd_iommu_stats_add(&compl_wait);
amd_iommu_stats_add(&cnt_map_single);
@@ -2267,6 +2269,13 @@ static int device_change_notifier(struct notifier_block *nb,
list_add_tail(&dma_domain->list, &iommu_pd_list);
spin_unlock_irqrestore(&iommu_pd_list_lock, flags);
+ dev_data = get_dev_data(dev);
+
+ if (!dev_data->passthrough)
+ dev->archdata.dma_ops = &amd_iommu_dma_ops;
+ else
+ dev->archdata.dma_ops = &nommu_dma_ops;
+
break;
case BUS_NOTIFY_DEL_DEVICE:
OpenPOWER on IntegriCloud