summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2016-10-06 06:13:36 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-10-12 16:02:13 -0400
commitf5069622bb6233e62f8842c5136f2ea5e8c1e0c8 (patch)
tree00ff6bb17b442d7ddb480d05fcd694766bf365b8 /drivers/gpu/nvgpu/gk20a/mm_gk20a.h
parent1b2529ba68bdd57231b59f2cb6d4f232e3956853 (diff)
gpu: nvgpu: make sure vidmem is cleared only once
Protect the initial vidmem zeroing performed during the first userspace alloc with a mutex, so that it blocks next concurrent users and is run only once. Otherwise, multiple clears could end up running in parallel, so that the next ones corrupt memory allocated by the thread that has finished earlier and advanced to allocate and use memory. Jira DNVGPU-84 Change-Id: If497749abf481b230835250191d011c4a9d1483b Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1232461 (cherry picked from commit 79435a68e6d2713b78acdb0ec6f77cfd78651d7f) Reviewed-on: http://git-master/r/1234990 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/mm_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/mm_gk20a.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
index 8ce110a1..ee2bb61e 100644
--- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.h
@@ -417,6 +417,7 @@ struct mm_gk20a {
417 417
418 u32 ce_ctx_id; 418 u32 ce_ctx_id;
419 bool cleared; 419 bool cleared;
420 struct mutex first_clear_mutex;
420 421
421 struct list_head clear_list_head; 422 struct list_head clear_list_head;
422 struct mutex clear_list_mutex; 423 struct mutex clear_list_mutex;