summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/amd_iommu.c
diff options
context:
space:
mode:
authorJoerg Roedel2015-12-21 13:23:59 +0100
committerJoerg Roedel2015-12-28 17:18:50 +0100
commit84b3a0bc88534d9e49d1642957f64db61a3aa5c4 (patch)
tree4e19eaf27b3d1c341c85a62c7691ab20d8886569 /drivers/iommu/amd_iommu.c
parentiommu/amd: Flush IOMMU TLB on __map_single error path (diff)
downloadkernel-qcow2-linux-84b3a0bc88534d9e49d1642957f64db61a3aa5c4.tar.gz
kernel-qcow2-linux-84b3a0bc88534d9e49d1642957f64db61a3aa5c4.tar.xz
kernel-qcow2-linux-84b3a0bc88534d9e49d1642957f64db61a3aa5c4.zip
iommu/amd: Flush the IOMMU TLB before the addresses are freed
This allows to keep the bitmap_lock only for a very short period of time. Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r--drivers/iommu/amd_iommu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 42c0a81ba9b3..69021ec79da9 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -2527,14 +2527,14 @@ static void __unmap_single(struct dma_ops_domain *dma_dom,
start += PAGE_SIZE;
}
- SUB_STATS_COUNTER(alloced_io_mem, size);
-
- dma_ops_free_addresses(dma_dom, dma_addr, pages);
-
if (amd_iommu_unmap_flush || dma_dom->need_flush) {
domain_flush_pages(&dma_dom->domain, flush_addr, size);
dma_dom->need_flush = false;
}
+
+ SUB_STATS_COUNTER(alloced_io_mem, size);
+
+ dma_ops_free_addresses(dma_dom, dma_addr, pages);
}
/*