diff options
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c index 4ed55971..8cd1bd0b 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_allocator_buddy.c | |||
@@ -1143,6 +1143,16 @@ int __gk20a_buddy_allocator_init(struct gk20a_allocator *__a, | |||
1143 | if (flags & GPU_ALLOC_GVA_SPACE) | 1143 | if (flags & GPU_ALLOC_GVA_SPACE) |
1144 | a->pte_blk_order = balloc_get_order(a, vm->big_page_size << 10); | 1144 | a->pte_blk_order = balloc_get_order(a, vm->big_page_size << 10); |
1145 | 1145 | ||
1146 | /* | ||
1147 | * When we have a GVA space with big_pages enabled the size and base | ||
1148 | * must be PDE aligned. If big_pages are not enabled then this | ||
1149 | * requirement is not necessary. | ||
1150 | */ | ||
1151 | if (flags & GPU_ALLOC_GVA_SPACE && vm->big_pages && | ||
1152 | (base & ((vm->big_page_size << 10) - 1) || | ||
1153 | size & ((vm->big_page_size << 10) - 1))) | ||
1154 | return -EINVAL; | ||
1155 | |||
1146 | a->flags = flags; | 1156 | a->flags = flags; |
1147 | a->max_order = max_order; | 1157 | a->max_order = max_order; |
1148 | 1158 | ||