From 939d3d5c4cbc7455a9a79a31316824dba6337dd2 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 21 Jun 2018 13:59:51 +0300 Subject: gpu: nvgpu: zero prealloc indices on init Initialize the prealloc job list put and get indices to zero when allocating these resources. Otherwise we'd get whatever got left from the channel's previous lifetime. Change-Id: Idb17ec7bfbd0c1e2121c7a63e41dc5845560e988 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1756871 Reviewed-by: svc-mobile-coverity Reviewed-by: Deepak Nibade Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sami Kiminki GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 4e6837ef..50e29cf6 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1012,6 +1012,8 @@ static int channel_gk20a_prealloc_resources(struct channel_gk20a *c, goto clean_up_priv_cmd; c->joblist.pre_alloc.length = num_jobs; + c->joblist.pre_alloc.put = 0; + c->joblist.pre_alloc.get = 0; /* * commit the previous writes before setting the flag. -- cgit v1.2.2