summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/common/mm/buddy_allocator.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
index c0d1335e..0ce9ae8a 100644
--- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
+++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c
@@ -1350,11 +1350,13 @@ int nvgpu_buddy_allocator_init(struct gk20a *g, struct nvgpu_allocator *na,
1350 * must be PDE aligned. If big_pages are not enabled then this 1350 * must be PDE aligned. If big_pages are not enabled then this
1351 * requirement is not necessary. 1351 * requirement is not necessary.
1352 */ 1352 */
1353 base_big_page = base & ((vm->big_page_size << 10U) - 1U); 1353 if (is_gva_space) {
1354 size_big_page = size & ((vm->big_page_size << 10U) - 1U); 1354 base_big_page = base & ((vm->big_page_size << 10U) - 1U);
1355 if (is_gva_space && vm->big_pages && 1355 size_big_page = size & ((vm->big_page_size << 10U) - 1U);
1356 (base_big_page != 0ULL || size_big_page != 0ULL)) { 1356 if (vm->big_pages &&
1357 return -EINVAL; 1357 (base_big_page != 0ULL || size_big_page != 0ULL)) {
1358 return -EINVAL;
1359 }
1358 } 1360 }
1359 1361
1360 a->flags = flags; 1362 a->flags = flags;