From 8ee3aa4b3175d8d27e57a0f5d5e2cdf3d78a4a58 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Tue, 24 Jan 2017 19:00:42 +0530 Subject: gpu: nvgpu: use common nvgpu mutex/spinlock APIs Instead of using Linux APIs for mutex and spinlocks directly, use new APIs defined in Replace Linux specific mutex/spinlock declaration, init, lock, unlock APIs with new APIs e.g struct mutex is replaced by struct nvgpu_mutex and mutex_lock() is replaced by nvgpu_mutex_acquire() And also include instead of including and Add explicit nvgpu/lock.h includes to below files to fix complilation failures. gk20a/platform_gk20a.h include/nvgpu/allocator.h Jira NVGPU-13 Change-Id: I81a05d21ecdbd90c2076a9f0aefd0e40b215bd33 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1293187 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/vgpu/gr_vgpu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/vgpu/gr_vgpu.c') diff --git a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c index 36bbee00..5c637d25 100644 --- a/drivers/gpu/nvgpu/vgpu/gr_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/gr_vgpu.c @@ -866,7 +866,7 @@ static int vgpu_gr_init_gr_setup_sw(struct gk20a *g) gr->g = g; #if defined(CONFIG_GK20A_CYCLE_STATS) - mutex_init(&g->gr.cs_lock); + nvgpu_mutex_init(&g->gr.cs_lock); #endif err = vgpu_gr_init_gr_config(g, gr); @@ -885,7 +885,7 @@ static int vgpu_gr_init_gr_setup_sw(struct gk20a *g) if (err) goto clean_up; - mutex_init(&gr->ctx_mutex); + nvgpu_mutex_init(&gr->ctx_mutex); gr->sm_error_states = kzalloc( sizeof(struct nvgpu_dbg_gpu_sm_error_state_record) * @@ -1078,9 +1078,9 @@ static int vgpu_gr_clear_sm_error_state(struct gk20a *g, { struct gr_gk20a *gr = &g->gr; - mutex_lock(&g->dbg_sessions_lock); + nvgpu_mutex_acquire(&g->dbg_sessions_lock); memset(&gr->sm_error_states[sm_id], 0, sizeof(*gr->sm_error_states)); - mutex_unlock(&g->dbg_sessions_lock); + nvgpu_mutex_release(&g->dbg_sessions_lock); return 0; } @@ -1096,7 +1096,7 @@ void vgpu_gr_handle_sm_esr_event(struct gk20a *g, return; } - mutex_lock(&g->dbg_sessions_lock); + nvgpu_mutex_acquire(&g->dbg_sessions_lock); sm_error_states = &g->gr.sm_error_states[info->sm_id]; @@ -1108,7 +1108,7 @@ void vgpu_gr_handle_sm_esr_event(struct gk20a *g, sm_error_states->hww_warp_esr_report_mask = info->hww_warp_esr_report_mask; - mutex_unlock(&g->dbg_sessions_lock); + nvgpu_mutex_release(&g->dbg_sessions_lock); } void vgpu_init_gr_ops(struct gpu_ops *gops) -- cgit v1.2.2