From df6496384794169c833c82c7aa4d9f1b0100b7e1 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 10 Aug 2017 18:17:55 -0700 Subject: gpu: nvgpu: Fix length passed to VIDMEM map The call to __set_pd_level() for vidmem allocs had the wrong length being passed in. This was a silent error since the subsequent __set_pd_level() calls overwrote the bad mappings. However this caused significantly more PDE/PTE writes than necessary since each chunk could be mapped N times where N is the number of chunks in an SGL. Change-Id: Ied7247b70825dc91b9eea1c3350f4ef370ab1a52 Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1537078 Reviewed-by: svccoveritychecker Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/common/mm/gmmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/common') diff --git a/drivers/gpu/nvgpu/common/mm/gmmu.c b/drivers/gpu/nvgpu/common/mm/gmmu.c index 30be1b85..73dff2c3 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu.c +++ b/drivers/gpu/nvgpu/common/mm/gmmu.c @@ -501,7 +501,7 @@ static int __nvgpu_gmmu_update_page_table_vidmem(struct vm_gk20a *vm, err = __set_pd_level(vm, &vm->pdb, 0, phys_addr, - virt_addr, length, + virt_addr, chunk_length, attrs); if (err) break; -- cgit v1.2.2