summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2016-08-31 05:40:11 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-09-08 12:43:46 -0400
commit0ca01a3355c5a17847f964f6f604b3084b4ea613 (patch)
tree144260dcf48f28217ca5944e893fdeb82e0faa47 /drivers/gpu/nvgpu/gk20a/mm_gk20a.c
parent4e0e13d92bf19674725e1185b3aadc66e2a25fac (diff)
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 <dnibade@nvidia.com> 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 <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.c3
1 files changed, 2 insertions, 1 deletions
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,
172 gk20a_readl(g, start_reg); 172 gk20a_readl(g, start_reg);
173 gk20a_pramin_exit(g, mem, chunk); 173 gk20a_pramin_exit(g, mem, chunk);
174 174
175 offset += n / sizeof(u32);
176 size -= n; 175 size -= n;
177 176
178 if (n == (chunk->length - offset)) { 177 if (n == (chunk->length - offset)) {
179 chunk = list_next_entry(chunk, list_entry); 178 chunk = list_next_entry(chunk, list_entry);
180 offset = 0; 179 offset = 0;
180 } else {
181 offset += n / sizeof(u32);
181 } 182 }
182 } 183 }
183} 184}