diff options
author | Joerg Roedel <jroedel@suse.de> | 2016-07-07 09:31:13 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2016-07-14 04:21:15 -0400 |
commit | d26592a93ddb7a73cbd82b08e2e0d2985d68d750 (patch) | |
tree | 931bc4de02657cd2ee00eb2024ed08b80c502a58 | |
parent | 80187fd39dcb30e3aa39e93a87b2d2f7fc8f4fd5 (diff) |
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>
-rw-r--r-- | drivers/iommu/amd_iommu.c | 7 |
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, | |||
2215 | static struct protection_domain *get_domain(struct device *dev) | 2215 | static struct protection_domain *get_domain(struct device *dev) |
2216 | { | 2216 | { |
2217 | struct protection_domain *domain; | 2217 | struct protection_domain *domain; |
2218 | struct iommu_domain *io_domain; | ||
2219 | 2218 | ||
2220 | if (!check_device(dev)) | 2219 | if (!check_device(dev)) |
2221 | return ERR_PTR(-EINVAL); | 2220 | return ERR_PTR(-EINVAL); |
2222 | 2221 | ||
2223 | io_domain = iommu_get_domain_for_dev(dev); | 2222 | domain = get_dev_data(dev)->domain; |
2224 | if (!io_domain) | ||
2225 | return NULL; | ||
2226 | |||
2227 | domain = to_pdomain(io_domain); | ||
2228 | if (!dma_ops_domain(domain)) | 2223 | if (!dma_ops_domain(domain)) |
2229 | return ERR_PTR(-EBUSY); | 2224 | return ERR_PTR(-EBUSY); |
2230 | 2225 | ||