From 98186ec2c2127c2af65a34f9e697e04f518a79ab Mon Sep 17 00:00:00 2001 From: Debarshi Dutta Date: Thu, 3 Aug 2017 15:34:44 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1533044 Reviewed-by: svccoveritychecker Reviewed-by: svc-mobile-coverity Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/common/linux/module.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/module.c') 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) 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); -- cgit v1.2.2