summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2015-06-11 17:16:50 -0400
committerAlex Waterman <alexw@nvidia.com>2015-07-20 14:33:02 -0400
commit12f245163d835d8367c0446798ab42aea6cf7ed9 (patch)
treee0d448fb982c21f28c70bb9a4870b46bab4e96f5 /drivers
parent4a3f84d257686cf598e8cfc27bb1735af65271a3 (diff)
gpu: nvgpu: Fix address space limit computation
The address space limit was being computed with the assumption that the va_limit field is inclusive. The va_limit field is actually not inclusive. It points to the first invalid byte. Thus when generating the adr_limit register the code incorrectly calculated that the address limit should be 0. To fix this the computation now just uses va_limit - 1. Also, the bitwise OR of 0xfff into the lower limit word was incorrect. The bottom 12 bits of the lower 32 bit word are ignored by the GPU and as such should not be populated. Change-Id: Ifcc13343aaf50776f3cf1a1e3726e73ffde5003f Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/756690 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/771151 Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
index 0deadfd0..32ccc5b8 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
@@ -3209,10 +3209,10 @@ void gk20a_init_inst_block(struct mem_desc *inst_block, struct vm_gk20a *vm,
3209 g->ops.mm.init_pdb(g, inst_ptr, pde_addr); 3209 g->ops.mm.init_pdb(g, inst_ptr, pde_addr);
3210 3210
3211 gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_lo_w(), 3211 gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_lo_w(),
3212 u64_lo32(vm->va_limit) | 0xFFF); 3212 u64_lo32(vm->va_limit - 1) & ~0xfff);
3213 3213
3214 gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_hi_w(), 3214 gk20a_mem_wr32(inst_ptr, ram_in_adr_limit_hi_w(),
3215 ram_in_adr_limit_hi_f(u64_hi32(vm->va_limit))); 3215 ram_in_adr_limit_hi_f(u64_hi32(vm->va_limit - 1)));
3216 3216
3217 if (big_page_size && g->ops.mm.set_big_page_size) 3217 if (big_page_size && g->ops.mm.set_big_page_size)
3218 g->ops.mm.set_big_page_size(g, inst_ptr, big_page_size); 3218 g->ops.mm.set_big_page_size(g, inst_ptr, big_page_size);