diff options
author | Joerg Roedel <jroedel@suse.de> | 2015-12-21 20:20:03 +0300 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2015-12-28 19:18:52 +0300 |
commit | d41ab09896dcfc517a7aa050b5c8563b5682a71d (patch) | |
tree | b9700abd9729a328f5a4348fc0655a897150c981 /drivers/iommu | |
parent | ebaecb423bfa0f88487aa98238c89fd3df9734dc (diff) | |
download | linux-d41ab09896dcfc517a7aa050b5c8563b5682a71d.tar.xz |
iommu/amd: Flush iommu tlb in dma_ops_free_addresses
Instead of setting need_flush, do the flush directly in
dma_ops_free_addresses.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index a26cd76588cd..62a407947b02 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c @@ -1648,8 +1648,10 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom, return; #endif - if ((address >> APERTURE_RANGE_SHIFT) >= dom->next_index) - dom->need_flush = true; + if (address + pages > range->next_bit) { + domain_flush_tlb(&dom->domain); + domain_flush_complete(&dom->domain); + } address = (address % APERTURE_RANGE_SIZE) >> PAGE_SHIFT; |