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/debug_fifo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/linux/debug_fifo.c') diff --git a/drivers/gpu/nvgpu/common/linux/debug_fifo.c b/drivers/gpu/nvgpu/common/linux/debug_fifo.c index a240a138..1763eb7e 100644 --- a/drivers/gpu/nvgpu/common/linux/debug_fifo.c +++ b/drivers/gpu/nvgpu/common/linux/debug_fifo.c @@ -167,7 +167,7 @@ static int gk20a_fifo_profile_enable(void *data, u64 val) } kref_init(&f->profile.ref); } - atomic_set(&f->profile.get, 0); + atomic_set(&f->profile.get.atomic_var, 0); f->profile.enabled = true; } } @@ -246,7 +246,7 @@ static int gk20a_fifo_profile_stats(struct seq_file *s, void *unused) return 0; } - get = atomic_read(&g->fifo.profile.get); + get = atomic_read(&g->fifo.profile.get.atomic_var); __gk20a_fifo_create_stats(g, percentiles_ioctl, PROFILE_IOCTL_EXIT, PROFILE_IOCTL_ENTRY); @@ -311,7 +311,7 @@ void gk20a_fifo_debugfs_init(struct gk20a *g) nvgpu_mutex_init(&g->fifo.profile.lock); g->fifo.profile.enabled = false; - atomic_set(&g->fifo.profile.get, 0); + atomic_set(&g->fifo.profile.get.atomic_var, 0); atomic_set(&g->fifo.profile.ref.refcount, 0); debugfs_create_file("enable", 0600, profile_root, g, @@ -342,7 +342,7 @@ struct fifo_profile_gk20a *gk20a_fifo_profile_acquire(struct gk20a *g) /* If kref is zero, profiling is not enabled */ if (!kref_get_unless_zero(&f->profile.ref)) return NULL; - index = atomic_inc_return(&f->profile.get); + index = atomic_inc_return(&f->profile.get.atomic_var); profile = &f->profile.data[index % FIFO_PROFILING_ENTRIES]; return profile; -- cgit v1.2.2