diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-13 20:55:11 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-15 03:17:23 -0400 |
commit | acea0018a24b794e32afea4f3be4230c58f2f8e3 (patch) | |
tree | 326c0a66e9ab48637acce9dea20dabe4eefd2023 /drivers/pci/intel-iommu.c | |
parent | 3d39cecc4841e8d4c4abdb401d10180f5faaded0 (diff) |
intel-iommu: Defer the iotlb flush and iova free for intel_unmap_sg() too.
I see no reason why we did this _only_ in intel_unmap_page().
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/pci/intel-iommu.c')
-rw-r--r-- | drivers/pci/intel-iommu.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c index d6a857397ec3..ee48fd073140 100644 --- a/drivers/pci/intel-iommu.c +++ b/drivers/pci/intel-iommu.c | |||
@@ -2815,11 +2815,18 @@ static void intel_unmap_sg(struct device *hwdev, struct scatterlist *sglist, | |||
2815 | /* free page tables */ | 2815 | /* free page tables */ |
2816 | dma_pte_free_pagetable(domain, start_pfn, last_pfn); | 2816 | dma_pte_free_pagetable(domain, start_pfn, last_pfn); |
2817 | 2817 | ||
2818 | iommu_flush_iotlb_psi(iommu, domain->id, start_pfn, | 2818 | if (intel_iommu_strict) { |
2819 | (last_pfn - start_pfn + 1)); | 2819 | iommu_flush_iotlb_psi(iommu, domain->id, start_pfn, |
2820 | 2820 | last_pfn - start_pfn + 1); | |
2821 | /* free iova */ | 2821 | /* free iova */ |
2822 | __free_iova(&domain->iovad, iova); | 2822 | __free_iova(&domain->iovad, iova); |
2823 | } else { | ||
2824 | add_unmap(domain, iova); | ||
2825 | /* | ||
2826 | * queue up the release of the unmap to save the 1/6th of the | ||
2827 | * cpu used up by the iotlb flush operation... | ||
2828 | */ | ||
2829 | } | ||
2823 | } | 2830 | } |
2824 | 2831 | ||
2825 | static int intel_nontranslate_map_sg(struct device *hddev, | 2832 | static int intel_nontranslate_map_sg(struct device *hddev, |