diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2017-08-03 06:04:44 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-08-17 17:26:47 -0400 |
commit | 98186ec2c2127c2af65a34f9e697e04f518a79ab (patch) | |
tree | 08ad87f3bf8c739e96b36f01728a8f7a30749a0e /drivers/gpu/nvgpu/common/linux/module.c | |
parent | 49dc335cfe588179cbb42d8bab53bc76ba88b28f (diff) |
gpu: nvgpu: Add wrapper over atomic_t and atomic64_t
- added wrapper structs nvgpu_atomic_t and nvgpu_atomic64_t over
atomic_t and atomic64_t
- added nvgpu_atomic_* and nvgpu_atomic64_* APIs to access the above
wrappers.
JIRA NVGPU-121
Change-Id: I61667bb0a84c2fc475365abb79bffb42b8b4786a
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1533044
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/module.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index bfbe7a58..f5c6ca1f 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -68,13 +68,13 @@ int gk20a_busy(struct gk20a *g) | |||
68 | if (!g) | 68 | if (!g) |
69 | return -ENODEV; | 69 | return -ENODEV; |
70 | 70 | ||
71 | atomic_inc(&g->usage_count); | 71 | atomic_inc(&g->usage_count.atomic_var); |
72 | 72 | ||
73 | down_read(&g->busy_lock); | 73 | down_read(&g->busy_lock); |
74 | 74 | ||
75 | if (!gk20a_can_busy(g)) { | 75 | if (!gk20a_can_busy(g)) { |
76 | ret = -ENODEV; | 76 | ret = -ENODEV; |
77 | atomic_dec(&g->usage_count); | 77 | atomic_dec(&g->usage_count.atomic_var); |
78 | goto fail; | 78 | goto fail; |
79 | } | 79 | } |
80 | 80 | ||
@@ -87,7 +87,7 @@ int gk20a_busy(struct gk20a *g) | |||
87 | /* Mark suspended so runtime pm will retry later */ | 87 | /* Mark suspended so runtime pm will retry later */ |
88 | pm_runtime_set_suspended(dev); | 88 | pm_runtime_set_suspended(dev); |
89 | pm_runtime_put_noidle(dev); | 89 | pm_runtime_put_noidle(dev); |
90 | atomic_dec(&g->usage_count); | 90 | atomic_dec(&g->usage_count.atomic_var); |
91 | goto fail; | 91 | goto fail; |
92 | } | 92 | } |
93 | } else { | 93 | } else { |
@@ -97,7 +97,7 @@ int gk20a_busy(struct gk20a *g) | |||
97 | vgpu_pm_finalize_poweron(dev) | 97 | vgpu_pm_finalize_poweron(dev) |
98 | : gk20a_pm_finalize_poweron(dev); | 98 | : gk20a_pm_finalize_poweron(dev); |
99 | if (ret) { | 99 | if (ret) { |
100 | atomic_dec(&g->usage_count); | 100 | atomic_dec(&g->usage_count.atomic_var); |
101 | nvgpu_mutex_release(&g->poweron_lock); | 101 | nvgpu_mutex_release(&g->poweron_lock); |
102 | goto fail; | 102 | goto fail; |
103 | } | 103 | } |
@@ -120,7 +120,7 @@ void gk20a_idle(struct gk20a *g) | |||
120 | { | 120 | { |
121 | struct device *dev; | 121 | struct device *dev; |
122 | 122 | ||
123 | atomic_dec(&g->usage_count); | 123 | atomic_dec(&g->usage_count.atomic_var); |
124 | 124 | ||
125 | dev = dev_from_gk20a(g); | 125 | dev = dev_from_gk20a(g); |
126 | 126 | ||