diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-09-04 09:39:26 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:11:10 -0400 |
commit | b81e9a2431e9a045e586ff028e0262e99202b3f0 (patch) | |
tree | 133891ddf59562794bc5913e0c0c688e245ed3ad /drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | |
parent | 949c47cbbb1f7560945b515c23a35b76475e16bf (diff) |
gpu: nvgpu: add refcounting for TSG
Add refcounting for TSGs and manage the refcounts as below :
- initialize ref when TSG is opened
- get ref when channel is bound to TSG
- drop the ref when channel is unbound (i.e. during channel close)
- drop the ref when TSG is closed
- when refcount drops to zero, we free the TSG
This refcounting makes it possible to close channels or TSG
in any order
Bug 1470692
Change-Id: Ia4b39164a4582c8169da62a91b9131094c67f5f8
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/495667
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h index dd8679be..4ad02996 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h | |||
@@ -35,6 +35,8 @@ struct tsg_gk20a { | |||
35 | bool in_use; | 35 | bool in_use; |
36 | int tsgid; | 36 | int tsgid; |
37 | 37 | ||
38 | struct kref refcount; | ||
39 | |||
38 | struct list_head ch_list; | 40 | struct list_head ch_list; |
39 | int num_active_channels; | 41 | int num_active_channels; |
40 | struct mutex ch_list_lock; | 42 | struct mutex ch_list_lock; |