From 9b70ad24934988141c585d9fd85c59f5c9d58a38 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Tue, 27 Mar 2018 10:27:06 +0300 Subject: gpu: nvgpu: delete semaphore release support Semaphores don't need to be released from CPU anymore, so clarify the code by deleting nvgpu_semaphore_release() and refactoring __nvgpu_semaphore_release() to nvgpu_semaphore_reset() that only "fast-forwards" the semaphore to a later value. While doing this, the meaning of nvgpu_semaphore_incr() changes, so rename it to nvgpu_semaphore_prepare(). Now it's only used to prepare an nvgpu_semaphore for a value that the HW will increment the sema to. Also change the BUG_ON that guards sema double-inits into just WARN_ON. Change-Id: I6f6df368ec5436cc97a229697742b6a4115dca51 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1680361 Reviewed-by: svc-mobile-coverity GVS: Gerrit_Virtual_Submit Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 8 ++++---- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 65b17304..5befe086 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -216,8 +216,8 @@ void gk20a_channel_abort_clean_up(struct channel_gk20a *ch) while (tmp_get != put) { job = &ch->joblist.pre_alloc.jobs[tmp_get]; if (job->post_fence->semaphore) { - __nvgpu_semaphore_release( - job->post_fence->semaphore, true, + nvgpu_semaphore_reset( + job->post_fence->semaphore, ch->hw_sema); released_job_semaphore = true; } @@ -228,8 +228,8 @@ void gk20a_channel_abort_clean_up(struct channel_gk20a *ch) &ch->joblist.dynamic.jobs, channel_gk20a_job, list) { if (job->post_fence->semaphore) { - __nvgpu_semaphore_release( - job->post_fence->semaphore, true, + nvgpu_semaphore_reset( + job->post_fence->semaphore, ch->hw_sema); released_job_semaphore = true; } diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index e94a112f..d87b8661 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -410,7 +410,7 @@ static void add_sema_cmd(struct gk20a *g, struct channel_gk20a *c, * incr the underlying sema next_value. */ if (!acquire) - nvgpu_semaphore_incr(s, c->hw_sema); + nvgpu_semaphore_prepare(s, c->hw_sema); /* semaphore_a */ nvgpu_mem_wr32(g, cmd->mem, off++, 0x20010004); -- cgit v1.2.2