diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/vm_area.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/vm_area.c b/drivers/gpu/nvgpu/common/mm/vm_area.c index 5ed2626f..6781d915 100644 --- a/drivers/gpu/nvgpu/common/mm/vm_area.c +++ b/drivers/gpu/nvgpu/common/mm/vm_area.c | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | #include <nvgpu/vm.h> | 23 | #include <nvgpu/vm.h> |
24 | #include <nvgpu/vm_area.h> | 24 | #include <nvgpu/vm_area.h> |
25 | #include <nvgpu/barrier.h> | ||
25 | 26 | ||
26 | #include "gk20a/gk20a.h" | 27 | #include "gk20a/gk20a.h" |
27 | #include "gk20a/mm_gk20a.h" | 28 | #include "gk20a/mm_gk20a.h" |
@@ -111,6 +112,13 @@ int nvgpu_vm_area_alloc(struct vm_gk20a *vm, u32 pages, u32 page_size, | |||
111 | if (pgsz_idx > gmmu_page_size_big) | 112 | if (pgsz_idx > gmmu_page_size_big) |
112 | return -EINVAL; | 113 | return -EINVAL; |
113 | 114 | ||
115 | /* | ||
116 | * pgsz_idx isn't likely to get too crazy, since it starts at 0 and | ||
117 | * increments but this ensures that we still have a definitely valid | ||
118 | * page size before proceeding. | ||
119 | */ | ||
120 | nvgpu_speculation_barrier(); | ||
121 | |||
114 | if (!vm->big_pages && pgsz_idx == gmmu_page_size_big) | 122 | if (!vm->big_pages && pgsz_idx == gmmu_page_size_big) |
115 | return -EINVAL; | 123 | return -EINVAL; |
116 | 124 | ||