From db1cc2720eb020465f552d1bcc3ebd62eaab1417 Mon Sep 17 00:00:00 2001 From: Joerg Roedel Date: Thu, 21 Jun 2012 14:52:40 +0200 Subject: [PATCH] --- yaml --- r: 311735 b: refs/heads/master c: ac1534a55d1e87d59a21c09c570605933b551480 h: refs/heads/master i: 311733: 1618255f5b1e082137161935192255fff040a476 311731: f2662fd55aafaf69ecc30e1749144bfa52dbb14a 311727: 2495d2d42534db3b8634f1f907874f04cdb86d66 v: v3 --- [refs] | 2 +- trunk/drivers/iommu/amd_iommu.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 3fdeaef2785f..a209d77fb730 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f2f12b6fc032c7b1419fd6db84e2868b5f05a878 +refs/heads/master: ac1534a55d1e87d59a21c09c570605933b551480 diff --git a/trunk/drivers/iommu/amd_iommu.c b/trunk/drivers/iommu/amd_iommu.c index a2e418cba0ff..dfe7d37c82c5 100644 --- a/trunk/drivers/iommu/amd_iommu.c +++ b/trunk/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 */ @@ -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: