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/pstate/pstate.c | 4 ++-- drivers/gpu/nvgpu/pstate/pstate.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/pstate') diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c index feb8cca8..dcb8464c 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.c +++ b/drivers/gpu/nvgpu/pstate/pstate.c @@ -1,7 +1,7 @@ /* * general p state infrastructure * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -333,7 +333,7 @@ static int pstate_sw_setup(struct gk20a *g) gk20a_dbg_fn(""); init_waitqueue_head(&g->perf_pmu.pstatesobjs.pstate_notifier_wq); - mutex_init(&g->perf_pmu.pstatesobjs.pstate_mutex); + nvgpu_mutex_init(&g->perf_pmu.pstatesobjs.pstate_mutex); err = boardobjgrpconstruct_e32(&g->perf_pmu.pstatesobjs.super); if (err) { diff --git a/drivers/gpu/nvgpu/pstate/pstate.h b/drivers/gpu/nvgpu/pstate/pstate.h index af0956e8..22ba98b9 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.h +++ b/drivers/gpu/nvgpu/pstate/pstate.h @@ -1,7 +1,7 @@ /* * general p state infrastructure * - * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -50,7 +50,7 @@ struct pstates { u32 num_levels; wait_queue_head_t pstate_notifier_wq; u32 is_pstate_switch_on; - struct mutex pstate_mutex; /* protect is_pstate_switch_on */ + struct nvgpu_mutex pstate_mutex; /* protect is_pstate_switch_on */ }; int gk20a_init_pstate_support(struct gk20a *g); -- cgit v1.2.2