aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/iova.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/iova.c')
-rw-r--r--drivers/pci/iova.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pci/iova.c b/drivers/pci/iova.c
index a84571c29360..8de7ab6c6d0c 100644
--- a/drivers/pci/iova.c
+++ b/drivers/pci/iova.c
@@ -9,19 +9,19 @@
9#include "iova.h" 9#include "iova.h"
10 10
11void 11void
12init_iova_domain(struct iova_domain *iovad) 12init_iova_domain(struct iova_domain *iovad, unsigned long pfn_32bit)
13{ 13{
14 spin_lock_init(&iovad->iova_alloc_lock); 14 spin_lock_init(&iovad->iova_alloc_lock);
15 spin_lock_init(&iovad->iova_rbtree_lock); 15 spin_lock_init(&iovad->iova_rbtree_lock);
16 iovad->rbroot = RB_ROOT; 16 iovad->rbroot = RB_ROOT;
17 iovad->cached32_node = NULL; 17 iovad->cached32_node = NULL;
18 18 iovad->dma_32bit_pfn = pfn_32bit;
19} 19}
20 20
21static struct rb_node * 21static struct rb_node *
22__get_cached_rbnode(struct iova_domain *iovad, unsigned long *limit_pfn) 22__get_cached_rbnode(struct iova_domain *iovad, unsigned long *limit_pfn)
23{ 23{
24 if ((*limit_pfn != DMA_32BIT_PFN) || 24 if ((*limit_pfn != iovad->dma_32bit_pfn) ||
25 (iovad->cached32_node == NULL)) 25 (iovad->cached32_node == NULL))
26 return rb_last(&iovad->rbroot); 26 return rb_last(&iovad->rbroot);
27 else { 27 else {
@@ -37,7 +37,7 @@ static void
37__cached_rbnode_insert_update(struct iova_domain *iovad, 37__cached_rbnode_insert_update(struct iova_domain *iovad,
38 unsigned long limit_pfn, struct iova *new) 38 unsigned long limit_pfn, struct iova *new)
39{ 39{
40 if (limit_pfn != DMA_32BIT_PFN) 40 if (limit_pfn != iovad->dma_32bit_pfn)
41 return; 41 return;
42 iovad->cached32_node = &new->node; 42 iovad->cached32_node = &new->node;
43} 43}