From db089a73a586b34e6266504925b29eea8628673e Mon Sep 17 00:00:00 2001 From: Shashank Singh Date: Thu, 28 Dec 2017 11:52:14 +0530 Subject: gpu: nvgpu: add refcounting for ctxsw disable/enable ctxsw disable could be called recursively for RM server. Suspend contexts disables ctxsw at the beginning, then call tsg disable and preempt. If preempt timeout happens, it goes to recovery path, which will try to disable ctxsw again. More details on Bug 200331110. Jira VQRM-2982 Change-Id: I4659c842ae73ed59be51ae65b25366f24abcaf22 Signed-off-by: Shashank Singh Signed-off-by: Richard Zhao Reviewed-on: https://git-master.nvidia.com/r/1671716 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Sourab Gupta Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 3442861c..4ebdb6a4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -1191,6 +1191,9 @@ struct gk20a { nvgpu_atomic_t usage_count; + struct nvgpu_mutex ctxsw_disable_lock; + int ctxsw_disable_count; + struct nvgpu_ref refcount; const char *name; -- cgit v1.2.2