diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-07-03 09:02:20 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:10:24 -0400 |
commit | 7c5404fa426c6f38b8330b2f70db552e1bfaba72 (patch) | |
tree | 9dedd18f2e1cdac3f1a151aad794f2a43e40d2c9 /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |
parent | 0b1f9e427205190dc5e651f78ff7f8be8641037e (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
(cherry picked from commit c4315c6caa42bab72ba6017c7ded25f4e9363dec)
Reviewed-on: http://git-master/r/435132
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Tested-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 677c4b49..a6ca8214 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -233,16 +233,9 @@ static int __gk20a_channel_syncpt_incr(struct gk20a_channel_sync *s, | |||
233 | thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 1); | 233 | thresh = nvhost_syncpt_incr_max_ext(sp->host1x_pdev, sp->id, 1); |
234 | 234 | ||
235 | if (register_irq) { | 235 | if (register_irq) { |
236 | /* nvhost action_gpfifo_submit_complete releases this ref. */ | 236 | err = nvhost_intr_register_notifier(sp->host1x_pdev, |
237 | err = gk20a_busy(c->g->dev); | 237 | sp->id, thresh, |
238 | 238 | gk20a_channel_syncpt_update, c); | |
239 | if (!err) { | ||
240 | err = nvhost_intr_register_notifier(sp->host1x_pdev, | ||
241 | sp->id, thresh, | ||
242 | gk20a_channel_syncpt_update, c); | ||
243 | if (err) | ||
244 | gk20a_idle(c->g->dev); | ||
245 | } | ||
246 | 239 | ||
247 | /* Adding interrupt action should never fail. A proper error | 240 | /* Adding interrupt action should never fail. A proper error |
248 | * handling here would require us to decrement the syncpt max | 241 | * handling here would require us to decrement the syncpt max |