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/gp106/sec2_gp106.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/sec2_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/sec2_gp106.c b/drivers/gpu/nvgpu/gp106/sec2_gp106.c index 9af16886..51e76605 100644 --- a/drivers/gpu/nvgpu/gp106/sec2_gp106.c +++ b/drivers/gpu/nvgpu/gp106/sec2_gp106.c @@ -114,7 +114,7 @@ void sec2_copy_to_dmem(struct pmu_gk20a *pmu, return; } - mutex_lock(&pmu->pmu_copy_lock); + nvgpu_mutex_acquire(&pmu->pmu_copy_lock); words = size >> 2; bytes = size & 0x3; @@ -144,7 +144,7 @@ void sec2_copy_to_dmem(struct pmu_gk20a *pmu, "copy failed. bytes written %d, expected %d", data - dst, size); } - mutex_unlock(&pmu->pmu_copy_lock); + nvgpu_mutex_release(&pmu->pmu_copy_lock); return; } @@ -348,10 +348,10 @@ int init_sec2_setup_hw1(struct gk20a *g, gk20a_dbg_fn(""); - mutex_lock(&pmu->isr_mutex); + nvgpu_mutex_acquire(&pmu->isr_mutex); g->ops.pmu.reset(g); pmu->isr_enabled = true; - mutex_unlock(&pmu->isr_mutex); + nvgpu_mutex_release(&pmu->isr_mutex); data = gk20a_readl(g, psec_fbif_ctl_r()); data |= psec_fbif_ctl_allow_phys_no_ctx_allow_f(); @@ -379,11 +379,11 @@ int init_sec2_setup_hw1(struct gk20a *g, psec_fbif_transcfg_target_noncoherent_sysmem_f()); /*disable irqs for hs falcon booting as we will poll for halt*/ - mutex_lock(&pmu->isr_mutex); + nvgpu_mutex_acquire(&pmu->isr_mutex); pmu_enable_irq(pmu, false); sec_enable_irq(pmu, false); pmu->isr_enabled = false; - mutex_unlock(&pmu->isr_mutex); + nvgpu_mutex_release(&pmu->isr_mutex); err = bl_bootstrap_sec2(pmu, desc, bl_sz); if (err) return err; -- cgit v1.2.2