From a191fd905a9ae437e849944804a800dc4c5e6d29 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Tue, 26 Apr 2016 17:23:19 -0700 Subject: gpu: nvgpu: Schedule channel update when jobs actually finish Do not schedule channel update call backs unless a job is actually finished. This saves a lot of call backs to the CDE code that don't do anything when semaphores are enabled. Bug 1732449 JIRA DNVGPU-12 Change-Id: I2f9a78498b08ebca44ee6a5171931a07721767f1 Signed-off-by: Alex Waterman Reviewed-on: http://git-master/r/1133786 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 5 +++-- 1 file changed, 3 insertions(+), 2 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 6ef8a6cf..5b259672 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1865,6 +1865,7 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work) struct channel_gk20a_job *job; struct gk20a_platform *platform; struct gk20a *g; + int job_finished = 0; c = gk20a_channel_get(c); if (!c) @@ -1934,11 +1935,11 @@ static void gk20a_channel_clean_up_jobs(struct work_struct *work) mutex_unlock(&c->jobs_lock); kfree(job); - + job_finished = 1; gk20a_idle(g->dev); } - if (c->update_fn) + if (job_finished && c->update_fn) schedule_work(&c->update_fn_work); gk20a_channel_put(c); -- cgit v1.2.2