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
This commit is contained in:
Debarshi Dutta
2017-08-03 15:34:44 +05:30
committed by mobile promotions
parent 49dc335cfe
commit 98186ec2c2
24 changed files with 355 additions and 120 deletions

View File

@@ -68,13 +68,13 @@ int gk20a_busy(struct gk20a *g)
if (!g)
return -ENODEV;
atomic_inc(&g->usage_count);
atomic_inc(&g->usage_count.atomic_var);
down_read(&g->busy_lock);
if (!gk20a_can_busy(g)) {
ret = -ENODEV;
atomic_dec(&g->usage_count);
atomic_dec(&g->usage_count.atomic_var);
goto fail;
}
@@ -87,7 +87,7 @@ int gk20a_busy(struct gk20a *g)
/* Mark suspended so runtime pm will retry later */
pm_runtime_set_suspended(dev);
pm_runtime_put_noidle(dev);
atomic_dec(&g->usage_count);
atomic_dec(&g->usage_count.atomic_var);
goto fail;
}
} else {
@@ -97,7 +97,7 @@ int gk20a_busy(struct gk20a *g)
vgpu_pm_finalize_poweron(dev)
: gk20a_pm_finalize_poweron(dev);
if (ret) {
atomic_dec(&g->usage_count);
atomic_dec(&g->usage_count.atomic_var);
nvgpu_mutex_release(&g->poweron_lock);
goto fail;
}
@@ -120,7 +120,7 @@ void gk20a_idle(struct gk20a *g)
{
struct device *dev;
atomic_dec(&g->usage_count);
atomic_dec(&g->usage_count.atomic_var);
dev = dev_from_gk20a(g);