From 4412728b9606a2e2506961ed6e444a344af7ca29 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Thu, 10 Aug 2017 18:31:53 -0700 Subject: gpu: nvgpu: Fix offset units in PRAMIN code The offset units in the nvgpu_pramin_access_batched() code changes midway through the function. In the first section it is treated as bytes but then in the while-loop iterating over the PRAMIN window and page_alloc_chunks it becomes an offset in words. This patch leaves the offset field in bytes and converts to words where needed. Change-Id: Iba964171679dfc27645238b297ed467a450b5cbc Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1537079 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/common/pramin.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common') diff --git a/drivers/gpu/nvgpu/common/pramin.c b/drivers/gpu/nvgpu/common/pramin.c index 688e5ce8..425bfdb4 100644 --- a/drivers/gpu/nvgpu/common/pramin.c +++ b/drivers/gpu/nvgpu/common/pramin.c @@ -96,10 +96,9 @@ void nvgpu_pramin_access_batched(struct gk20a *g, struct nvgpu_mem *mem, break; } - offset /= sizeof(u32); - while (size) { - byteoff = g->ops.pramin.enter(g, mem, chunk, offset); + byteoff = g->ops.pramin.enter(g, mem, chunk, + offset / sizeof(u32)); start_reg = g->ops.pramin.data032_r(byteoff / sizeof(u32)); until_end = SZ_1M - (byteoff & (SZ_1M - 1)); @@ -118,7 +117,7 @@ void nvgpu_pramin_access_batched(struct gk20a *g, struct nvgpu_mem *mem, list_entry); offset = 0; } else { - offset += n / sizeof(u32); + offset += n; } } } -- cgit v1.2.2