diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-07-03 18:32:20 +0530 |
---|---|---|
committer | Mandar Padmawar <mpadmawar@nvidia.com> | 2014-07-07 01:42:02 -0700 |
commit | c4315c6caa42bab72ba6017c7ded25f4e9363dec (patch) | |
tree | 79254278477a165dcc1fb45ce81d6f47a69f53c2 /drivers/gpu | |
parent | 561dc8e0933ff2d72573292968b893a52f5f783a (diff) |
gpu: nvgpu: remove redundant busy()/idle() calls
gk20a_busy() call in channel_syncpt_incr() and corresponding
gk20a_idle() call in channel_update() are redundant since they
are already encapsulated inside another pair of busy/idle calls
This busy/idle pair will be called only from submit_gpfifo()
and submit_gpfifo() already has its own busy/idle which it
preserves for whole path and hence this redundant pair can be
removed
Also, this prevents a dead lock scenario while do_idle() is in
progress as follows :
- in submit_gpfifo() we call first gk20a_busy() which acquires
busy read semaphore
- in do_idle() we acquire busy write semaphore and wait for
current jobs to finish
- now submit_gpfifo() encounters second gk20a_busy() and requests
busy read semaphore again
- this results in dead lock where do_idle() is waiting for
submit_gpfifo() to complete and submit_gpfifo() is waiting for
busy lock held by do_idle() and hence it cannot complete
bug 1529160
Change-Id: I96e4368352f693e93524f0f61689b4447e5331ea
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/434191
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 13 |
2 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 99cd8727d74f..cf6f119092af 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1388,10 +1388,8 @@ static int gk20a_channel_add_job(struct channel_gk20a *c, void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) { - struct gk20a *g = c->g; struct vm_gk20a *vm = c->vm; struct channel_gk20a_job *job, *n; - int i; wake_up(&c->submit_wq); @@ -1410,12 +1408,9 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) list_del_init(&job->list); kfree(job); - gk20a_idle(g->dev); + gk20a_idle(c->g->dev); } mutex_unlock(&c->jobs_lock); - - for (i = 0; i < nr_completed; i++) - gk20a_idle(c->g->dev); } static int gk20a_submit_channel_gpfifo(struct channel_gk20a *c, diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 841ec5967be2..eb435977e62d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c @@ -226,16 +226,9 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 1); if (register_irq) { - /* nvhost action_gpfifo_submit_complete releases this ref. */ - err = gk20a_busy(c->g->dev); - - if (!err) { - err = nvhost_intr_register_notifier(sp->host1x_pdev, - sp->id, thresh, - gk20a_channel_syncpt_update, c); - if (err) - gk20a_idle(c->g->dev); - } + err = nvhost_intr_register_notifier(sp->host1x_pdev, + sp->id, thresh, + gk20a_channel_syncpt_update, c); /* Adding interrupt action should never fail. A proper error * handling here would require us to decrement the syncpt max |