diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2017-02-01 04:36:27 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-02-22 07:14:57 -0500 |
commit | 76611c4268dec892b170fb245badfca5319fd645 (patch) | |
tree | b5ad8ae9a671652a1ff955f9c8459397ee3da5c3 /drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |
parent | e99a3dec3a7ac903c20b6843693d53087fb7bcab (diff) |
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 <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1297184
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 8 |
1 files changed, 3 insertions, 5 deletions
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) | |||
906 | struct dbg_session_gk20a *dbg_s; | 906 | struct dbg_session_gk20a *dbg_s; |
907 | struct dbg_session_data *session_data, *tmp_s; | 907 | struct dbg_session_data *session_data, *tmp_s; |
908 | struct dbg_session_channel_data *ch_data, *tmp; | 908 | struct dbg_session_channel_data *ch_data, *tmp; |
909 | bool was_reset; | ||
910 | 909 | ||
911 | gk20a_dbg_fn(""); | 910 | gk20a_dbg_fn(""); |
912 | 911 | ||
@@ -953,13 +952,12 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force) | |||
953 | if (g->fifo.deferred_reset_pending) { | 952 | if (g->fifo.deferred_reset_pending) { |
954 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" | 953 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" |
955 | " deferred, running now"); | 954 | " deferred, running now"); |
956 | was_reset = mutex_is_locked(&g->fifo.gr_reset_mutex); | ||
957 | mutex_lock(&g->fifo.gr_reset_mutex); | ||
958 | /* if lock is already taken, a reset is taking place | 955 | /* if lock is already taken, a reset is taking place |
959 | so no need to repeat */ | 956 | so no need to repeat */ |
960 | if (!was_reset) | 957 | if (mutex_trylock(&g->fifo.gr_reset_mutex)) { |
961 | gk20a_fifo_deferred_reset(g, ch); | 958 | gk20a_fifo_deferred_reset(g, ch); |
962 | mutex_unlock(&g->fifo.gr_reset_mutex); | 959 | mutex_unlock(&g->fifo.gr_reset_mutex); |
960 | } | ||
963 | } | 961 | } |
964 | mutex_unlock(&f->deferred_reset_mutex); | 962 | mutex_unlock(&f->deferred_reset_mutex); |
965 | 963 | ||