summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorJoerg Roedel2016-07-07 15:31:13 +0200
committerJoerg Roedel2016-07-14 10:21:15 +0200
commitd26592a93ddb7a73cbd82b08e2e0d2985d68d750 (patch)
tree931bc4de02657cd2ee00eb2024ed08b80c502a58 /drivers/iommu
parentiommu/amd: Optimize map_sg and unmap_sg (diff)
downloadkernel-qcow2-linux-d26592a93ddb7a73cbd82b08e2e0d2985d68d750.tar.gz
kernel-qcow2-linux-d26592a93ddb7a73cbd82b08e2e0d2985d68d750.tar.xz
kernel-qcow2-linux-d26592a93ddb7a73cbd82b08e2e0d2985d68d750.zip
iommu/amd: Use dev_data->domain in get_domain()
Using the cached value is much more efficient than calling into the IOMMU core code. Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd_iommu.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index acad37c3f0a1..155a3e6f1373 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2215,16 +2215,11 @@ static void queue_add(struct dma_ops_domain *dma_dom,
static struct protection_domain *get_domain(struct device *dev)
{
struct protection_domain *domain;
- struct iommu_domain *io_domain;
if (!check_device(dev))
return ERR_PTR(-EINVAL);
- io_domain = iommu_get_domain_for_dev(dev);
- if (!io_domain)
- return NULL;
-
- domain = to_pdomain(io_domain);
+ domain = get_dev_data(dev)->domain;
if (!dma_ops_domain(domain))
return ERR_PTR(-EBUSY);