]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Fix off-by-one error in PDE calculations
authorAlex Waterman <alexw@nvidia.com>
Tue, 28 Apr 2015 21:07:09 +0000 (14:07 -0700)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Thu, 30 Apr 2015 17:38:04 +0000 (10:38 -0700)
The number of entries in the next level PDE data structure was one
half of what was needed since the bit shift was 1 bit too small.

Change-Id: Ifcedd1dfad9b2cf5c4537887d38ec750a54518c4
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/736899
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/gpu/nvgpu/gk20a/mm_gk20a.c

index f0fbdd95972cd95ac1f0e293491b2c15f1fa59a6..f241abe384b19a77899de69f57ecec8560bd742a 100644 (file)
@@ -2019,7 +2019,7 @@ static int update_gmmu_level_locked(struct vm_gk20a *vm,
                                int num_entries =
                                        1 <<
                                         (l->hi_bit[pgsz_idx]
-                                         - l->lo_bit[pgsz_idx]);
+                                         - l->lo_bit[pgsz_idx] + 1);
                                pte->entries =
                                        kzalloc(sizeof(struct gk20a_mm_entry) *
                                                num_entries, GFP_KERNEL);