aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/iova.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-06-08 09:12:16 -0600
committerGrant Likely <grant.likely@secretlab.ca>2011-06-08 09:12:16 -0600
commitc226feb013ce81a18512fb4827bf7c2352d8b470 (patch)
tree4415ebda1c24f68bd7b88641f64097111eb359e0 /drivers/pci/iova.c
parent32919a28cc8470b1526f77b2f12cca8841b9ac62 (diff)
parent85ec7b970553369e0c956fab1d7a6022f2a99369 (diff)
Merge branch 'for_3.0/gpio-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into gpio/merge
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