From 0ca01a3355c5a17847f964f6f604b3084b4ea613 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 31 Aug 2016 15:10:11 +0530 Subject: gpu: nvgpu: fix non-contiguous pramin access In pramin_access_batched(), in each iteration of the loop we first decide size of data that we should write in that iteration. In case this size is equal to length of the chunk, we need to move to use next chunk for subsequent iteration But since we change offset variable before we check above, we end up using same chunk in next iteration Fix this by correcting the sequnce to first check if we should move to next chunk and then only adjust the offset variable Jira DNVGPU-24 Change-Id: I58c2e24678f4c6dfbe33bf111edd06788629eca8 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1210892 (cherry picked from commit 83cc179199692d28a93b3b884c9bc094ff513298) Reviewed-on: http://git-master/r/1213450 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 876f3115..e1f135e7 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c @@ -172,12 +172,13 @@ static inline void pramin_access_batched(struct gk20a *g, struct mem_desc *mem, gk20a_readl(g, start_reg); gk20a_pramin_exit(g, mem, chunk); - offset += n / sizeof(u32); size -= n; if (n == (chunk->length - offset)) { chunk = list_next_entry(chunk, list_entry); offset = 0; + } else { + offset += n / sizeof(u32); } } } -- cgit v1.2.2