mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
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:
committed by
mobile promotions
parent
49dc335cfe
commit
98186ec2c2
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user