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/gp10b/gr_gp10b.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gp10b/gr_gp10b.c') diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index e680e753..da121b56 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c @@ -1997,16 +1997,16 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g, int local_ctx_resident_ch_fd = -1; bool ctx_resident; - mutex_lock(&g->dbg_sessions_lock); + nvgpu_mutex_acquire(&g->dbg_sessions_lock); err = gr_gk20a_disable_ctxsw(g); if (err) { gk20a_err(dev_from_gk20a(g), "unable to stop gr ctxsw"); - mutex_unlock(&g->dbg_sessions_lock); + nvgpu_mutex_release(&g->dbg_sessions_lock); goto clean_up; } - mutex_lock(&dbg_s->ch_list_lock); + nvgpu_mutex_acquire(&dbg_s->ch_list_lock); list_for_each_entry(ch_data, &dbg_s->ch_list, ch_entry) { ch = g->fifo.channel + ch_data->chid; @@ -2019,15 +2019,15 @@ static int gr_gp10b_suspend_contexts(struct gk20a *g, cilp_preempt_pending_ch = ch; } - mutex_unlock(&dbg_s->ch_list_lock); + nvgpu_mutex_release(&dbg_s->ch_list_lock); err = gr_gk20a_enable_ctxsw(g); if (err) { - mutex_unlock(&g->dbg_sessions_lock); + nvgpu_mutex_release(&g->dbg_sessions_lock); goto clean_up; } - mutex_unlock(&g->dbg_sessions_lock); + nvgpu_mutex_release(&g->dbg_sessions_lock); if (cilp_preempt_pending_ch) { struct channel_ctx_gk20a *ch_ctx = -- cgit v1.2.2