summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-08-15 14:16:07 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-08-16 14:04:20 -0400
commit61ef5a58744d22e65d3ad7c3a04a2521d0ccb6af (patch)
tree5b8836864d06495101e15d381f8fdcb8f19f6a6a /drivers/gpu/nvgpu/gk20a/fence_gk20a.c
parentff38ab4dcd87088dc60c870aaf910fcdc4af5918 (diff)
gpu: nvgpu: Deterministic submit fix
Fix some simple pointer arithmetic errors in the deterministic submit path. The lockless allocator was doing a subtraction to determine the correct offset of the element to free. However, this subtraction was using the base address and a numeric offset - not a pointer offset. Thus the difference computed was in bytes not in elements of the block size. The fix is simple: just divide by the block size. Also this modifies the debugging statement a bit so that a bit more information is printed at more useful times. Lastly, a pointer to numeric cast was fixed in the fence code. Change-Id: I514724205f1b73805b21e979481a13ac689f3482 Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1538905 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index 51363059..8ad24c44 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -51,7 +51,7 @@ static void gk20a_fence_free(struct kref *ref)
51 51
52 if (f->allocator) { 52 if (f->allocator) {
53 if (nvgpu_alloc_initialized(f->allocator)) 53 if (nvgpu_alloc_initialized(f->allocator))
54 nvgpu_free(f->allocator, (size_t)f); 54 nvgpu_free(f->allocator, (u64)(uintptr_t)f);
55 } else 55 } else
56 nvgpu_kfree(g, f); 56 nvgpu_kfree(g, f);
57} 57}