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/clk_gp106.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gp106/clk_gp106.c') diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index edeb97ec..3b9c444d 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c @@ -1,7 +1,7 @@ /* * GP106 Clocks * - * 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, @@ -79,7 +79,7 @@ static int gp106_init_clk_support(struct gk20a *g) { gk20a_dbg_fn(""); - mutex_init(&clk->clk_mutex); + nvgpu_mutex_init(&clk->clk_mutex); clk->clk_namemap = (struct namemap_cfg *) kzalloc(sizeof(struct namemap_cfg) * NUM_NAMEMAPS, GFP_KERNEL); @@ -169,7 +169,7 @@ static u32 gp106_get_rate_cntr(struct gk20a *g, struct namemap_cfg *c) { if (!c || !c->cntr.reg_ctrl_addr || !c->cntr.reg_cntr_addr) return 0; - mutex_lock(&clk->clk_mutex); + nvgpu_mutex_acquire(&clk->clk_mutex); /* Save the register */ save_reg = gk20a_readl(g, c->cntr.reg_ctrl_addr); @@ -216,7 +216,7 @@ read_err: gk20a_readl(g, c->cntr.reg_ctrl_addr); gk20a_writel(g, c->cntr.reg_ctrl_addr, save_reg); gk20a_readl(g, c->cntr.reg_ctrl_addr); - mutex_unlock(&clk->clk_mutex); + nvgpu_mutex_release(&clk->clk_mutex); return cntr; -- cgit v1.2.2