aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/iova.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-06-02 05:48:50 +0900
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-02 05:48:50 +0900
commitf0f52a9463839c52a63c05d6e7d4a330d94a9794 (patch)
treed964f65aa37dd46b457bc615f2f37e75390c6df8 /drivers/pci/iova.c
parent0f48f2600911d5de6393829e4a9986d4075558b3 (diff)
parent70e535d1e5d1e4317e894d6228b762cf9c3fbc6a (diff)
downloadkernel_samsung_crespo-f0f52a9463839c52a63c05d6e7d4a330d94a9794.tar.gz
kernel_samsung_crespo-f0f52a9463839c52a63c05d6e7d4a330d94a9794.tar.bz2
kernel_samsung_crespo-f0f52a9463839c52a63c05d6e7d4a330d94a9794.zip
Merge git://git.infradead.org/iommu-2.6
* git://git.infradead.org/iommu-2.6: intel-iommu: Fix off-by-one in RMRR setup intel-iommu: Add domain check in domain_remove_one_dev_info intel-iommu: Remove Host Bridge devices from identity mapping intel-iommu: Use coherent DMA mask when requested intel-iommu: Dont cache iova above 32bit intel-iommu: Speed up processing of the identity_mapping function intel-iommu: Check for identity mapping candidate using system dma mask intel-iommu: Only unlink device domains from iommu intel-iommu: Enable super page (2MiB, 1GiB, etc.) support intel-iommu: Flush unmaps at domain_exit intel-iommu: Remove obsolete comment from detect_intel_iommu intel-iommu: fix VT-d PMR disable for TXT on S3 resume
Diffstat (limited to 'drivers/pci/iova.c')
-rw-r--r--drivers/pci/iova.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/pci/iova.c b/drivers/pci/iova.c
index 9606e599a47..c5c274ab5c5 100644
--- a/drivers/pci/iova.c
+++ b/drivers/pci/iova.c
@@ -63,8 +63,16 @@ __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free)
curr = iovad->cached32_node;
cached_iova = container_of(curr, struct iova, node);
- if (free->pfn_lo >= cached_iova->pfn_lo)
- iovad->cached32_node = rb_next(&free->node);
+ if (free->pfn_lo >= cached_iova->pfn_lo) {
+ struct rb_node *node = rb_next(&free->node);
+ struct iova *iova = container_of(node, struct iova, node);
+
+ /* only cache if it's below 32bit pfn */
+ if (node && iova->pfn_lo < iovad->dma_32bit_pfn)
+ iovad->cached32_node = node;
+ else
+ iovad->cached32_node = NULL;
+ }
}
/* Computes the padding size required, to make the