summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorDavid Nieto <dmartineznie@nvidia.com>2017-11-30 14:05:14 -0500
committerDeepak Bhosale <dbhosale@nvidia.com>2017-12-05 13:25:37 -0500
commit1b125d8cbe05766c0cfb0ba9cac2bf46ffef7c3a (patch)
tree8566528813e08666431abea7a0063816a7b15156 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parentfa2a3e2d3dd780d409e7673e7b47a34fd1cafb4f (diff)
gpu: nvgpu: fix indexing in locate pte function
The current code does not properly calculate the indexes within the PDE to access the proper entry, and it has a bug in assignement of the big page entries. This change fixes the issue by: (1) Passing a pointer to the level structure and dereferencing the index offset to the next level. (2) Changing the format of the address. (3) Ensuring big pages are only selected if their address is set. Bug 200364599 Change-Id: I46e32560ee341d8cfc08c077282dcb5549d2a140 Signed-off-by: David Nieto <dmartineznie@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1610562 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Deepak Bhosale <dbhosale@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 3635bfc2..0b383a83 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -287,6 +287,7 @@ static void update_gmmu_pte_locked(struct vm_gk20a *vm,
287} 287}
288 288
289enum gmmu_pgsz_gk20a gk20a_get_pde_pgsz(struct gk20a *g, 289enum gmmu_pgsz_gk20a gk20a_get_pde_pgsz(struct gk20a *g,
290 const struct gk20a_mmu_level *l,
290 struct nvgpu_gmmu_pd *pd, u32 pd_idx) 291 struct nvgpu_gmmu_pd *pd, u32 pd_idx)
291{ 292{
292 /* 293 /*
@@ -296,6 +297,7 @@ enum gmmu_pgsz_gk20a gk20a_get_pde_pgsz(struct gk20a *g,
296} 297}
297 298
298enum gmmu_pgsz_gk20a gk20a_get_pte_pgsz(struct gk20a *g, 299enum gmmu_pgsz_gk20a gk20a_get_pte_pgsz(struct gk20a *g,
300 const struct gk20a_mmu_level *l,
299 struct nvgpu_gmmu_pd *pd, u32 pd_idx) 301 struct nvgpu_gmmu_pd *pd, u32 pd_idx)
300{ 302{
301 /* 303 /*