summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
diff options
context:
space:
mode:
authorSourab Gupta <sourabg@nvidia.com>2018-04-30 06:23:22 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-05-07 07:42:29 -0400
commit2b498cdf8aaa6c628cc1ac8e2b0b3a582c0decb3 (patch)
tree7646f75c290fab717d674ebc9b6d6b870146523f /drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
parent3dabdf3e6d703ffdb4549ab54cf5bca34460706b (diff)
gpu: nvgpu: remove rcu locks in clk arbiter
RCU's are available only in (linux) kernel. Though they are able to achieve lockless access in some specific scenarios, they are heavily dependent on the kernel for their functionality. E.g. synchronize_rcu(), which depends on the kernel in order to delimit read side critical sections. As such it is very difficult to implement constructs analogous to RCUs in userspace code. As a result the code which depends on RCU's for synchronization is not portable between OS'es, especially if one of them is in userspace, viz. QNX. Also, if the code is not in performance critical path, we can do with non-RCU constructs. For clk arbiter code here, RCU's are replaced by the traditional spinlocks, so that the code could be used by QNX down the line. Jira VQRM-3741 Change-Id: I178e5958788c8fd998303a6a94d8f2f328201508 Signed-off-by: Sourab Gupta <sourabg@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1705535 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/clk_arb_linux.h')
-rw-r--r--drivers/gpu/nvgpu/common/linux/clk_arb_linux.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h b/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
index b66876da..0942dd86 100644
--- a/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
+++ b/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
@@ -41,11 +41,12 @@
41struct nvgpu_clk_arb { 41struct nvgpu_clk_arb {
42 struct nvgpu_spinlock sessions_lock; 42 struct nvgpu_spinlock sessions_lock;
43 struct nvgpu_spinlock users_lock; 43 struct nvgpu_spinlock users_lock;
44 struct nvgpu_spinlock requests_lock;
44 45
45 struct nvgpu_mutex pstate_lock; 46 struct nvgpu_mutex pstate_lock;
46 struct list_head users; 47 struct list_head users;
47 struct list_head sessions; 48 struct list_head sessions;
48 struct llist_head requests; 49 struct list_head requests;
49 50
50 struct gk20a *g; 51 struct gk20a *g;
51 int status; 52 int status;
@@ -92,7 +93,7 @@ struct nvgpu_clk_dev {
92 struct nvgpu_clk_session *session; 93 struct nvgpu_clk_session *session;
93 union { 94 union {
94 struct list_head link; 95 struct list_head link;
95 struct llist_node node; 96 struct list_head node;
96 }; 97 };
97 struct nvgpu_cond readout_wq; 98 struct nvgpu_cond readout_wq;
98 nvgpu_atomic_t poll_mask; 99 nvgpu_atomic_t poll_mask;
@@ -110,8 +111,9 @@ struct nvgpu_clk_session {
110 struct gk20a *g; 111 struct gk20a *g;
111 struct nvgpu_ref refcount; 112 struct nvgpu_ref refcount;
112 struct list_head link; 113 struct list_head link;
113 struct llist_head targets; 114 struct list_head targets;
114 115
116 struct nvgpu_spinlock session_lock;
115 struct nvgpu_clk_arb_target target_pool[2]; 117 struct nvgpu_clk_arb_target target_pool[2];
116 struct nvgpu_clk_arb_target *target; 118 struct nvgpu_clk_arb_target *target;
117}; 119};