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/sched_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/sched_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/sched_gk20a.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c index 54dbcfd1..20cd1232 100644 --- a/drivers/gpu/nvgpu/gk20a/sched_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sched_gk20a.c | |||
@@ -520,6 +520,7 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused) | |||
520 | struct device *dev = s->private; | 520 | struct device *dev = s->private; |
521 | struct gk20a *g = gk20a_get_platform(dev)->g; | 521 | struct gk20a *g = gk20a_get_platform(dev)->g; |
522 | struct gk20a_sched_ctrl *sched = &g->sched_ctrl; | 522 | struct gk20a_sched_ctrl *sched = &g->sched_ctrl; |
523 | bool sched_busy = true; | ||
523 | 524 | ||
524 | int n = sched->bitmap_size / sizeof(u64); | 525 | int n = sched->bitmap_size / sizeof(u64); |
525 | int i; | 526 | int i; |
@@ -529,8 +530,13 @@ static int gk20a_sched_debugfs_show(struct seq_file *s, void *unused) | |||
529 | if (err) | 530 | if (err) |
530 | return err; | 531 | return err; |
531 | 532 | ||
533 | if (mutex_trylock(&sched->busy_lock)) { | ||
534 | sched_busy = false; | ||
535 | mutex_unlock(&sched->busy_lock); | ||
536 | } | ||
537 | |||
532 | seq_printf(s, "control_locked=%d\n", sched->control_locked); | 538 | seq_printf(s, "control_locked=%d\n", sched->control_locked); |
533 | seq_printf(s, "busy=%d\n", mutex_is_locked(&sched->busy_lock)); | 539 | seq_printf(s, "busy=%d\n", sched_busy); |
534 | seq_printf(s, "bitmap_size=%zu\n", sched->bitmap_size); | 540 | seq_printf(s, "bitmap_size=%zu\n", sched->bitmap_size); |
535 | 541 | ||
536 | mutex_lock(&sched->status_lock); | 542 | mutex_lock(&sched->status_lock); |