From 76611c4268dec892b170fb245badfca5319fd645 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 1 Feb 2017 15:06:27 +0530 Subject: gpu: nvgpu: remove use of mutex_is_locked() mutex_is_locked() API is defined on Linux only and not on other OS like QNX. Hence remove use of this API for OS abstraction support to nvgpu. Instead of using mutex_is_locked(), use mutex_trylock() for same purpose Jira NVGPU-13 Change-Id: I542daf20a2294153da8e8bfe89e0dc0387297523 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1297184 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 3dda1cbf..376a64b0 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -906,7 +906,6 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) struct dbg_session_gk20a *dbg_s; struct dbg_session_data *session_data, *tmp_s; struct dbg_session_channel_data *ch_data, *tmp; - bool was_reset; gk20a_dbg_fn(""); @@ -953,13 +952,12 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) if (g->fifo.deferred_reset_pending) { gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" " deferred, running now"); - was_reset = mutex_is_locked(&g->fifo.gr_reset_mutex); - mutex_lock(&g->fifo.gr_reset_mutex); /* if lock is already taken, a reset is taking place so no need to repeat */ - if (!was_reset) + if (mutex_trylock(&g->fifo.gr_reset_mutex)) { gk20a_fifo_deferred_reset(g, ch); - mutex_unlock(&g->fifo.gr_reset_mutex); + mutex_unlock(&g->fifo.gr_reset_mutex); + } } mutex_unlock(&f->deferred_reset_mutex); -- cgit v1.2.2