summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
index 8cd1bd0b..dd7f4d27 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c
@@ -1101,6 +1101,7 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1101 u64 max_order, u64 flags) 1101 u64 max_order, u64 flags)
1102{ 1102{
1103 int err; 1103 int err;
1104 u64 pde_size;
1104 struct gk20a_buddy_allocator *a; 1105 struct gk20a_buddy_allocator *a;
1105 1106
1106 /* blk_size must be greater than 0 and a power of 2. */ 1107 /* blk_size must be greater than 0 and a power of 2. */
@@ -1140,8 +1141,10 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a,
1140 } 1141 }
1141 1142
1142 a->vm = vm; 1143 a->vm = vm;
1143 if (flags & GPU_ALLOC_GVA_SPACE) 1144 if (flags & GPU_ALLOC_GVA_SPACE) {
1144 a->pte_blk_order = balloc_get_order(a, vm->big_page_size << 10); 1145 pde_size = ((u64)vm->big_page_size) << 10;
1146 a->pte_blk_order = balloc_get_order(a, pde_size);
1147 }
1145 1148
1146 /* 1149 /*
1147 * When we have a GVA space with big_pages enabled the size and base 1150 * When we have a GVA space with big_pages enabled the size and base