From 9713e3572a740216c6ecbc2257349be51c204a67 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Wed, 6 Jan 2016 14:37:38 +0530 Subject: gpu: nvgpu: disable ctxsw instead of all engines activity In gk20a_channel_timeout_handler(), we currently disable all engine activity before checking for fence completion and before we identify timed out channel But disabling all engine activity could be overkill for this process. Also, as part of disabling engine activity we preempt the channel on engine. But it is possible that channel preemption times out since channel has already timed out And this can lead to races and deadlock Hence, instead of disabling all engine activity, just disable the context switch which should also do the same trick Bug 1716062 Change-Id: I596515ed670a2e134f7bcd9758488a4aa0bf16f7 Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/929421 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 0421c0f6..f0a700ac 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1671,11 +1671,11 @@ static void gk20a_channel_timeout_handler(struct work_struct *work) ch->timeout.initialized = false; mutex_unlock(&ch->timeout.lock); - if (gk20a_fifo_disable_all_engine_activity(g, true)) + if (gr_gk20a_disable_ctxsw(g)) goto fail_unlock; if (gk20a_fence_is_expired(job->post_fence)) - goto fail_enable_engine_activity; + goto fail_enable_ctxsw; gk20a_err(dev_from_gk20a(g), "Job on channel %d timed out\n", ch->hw_chid); @@ -1698,7 +1698,7 @@ static void gk20a_channel_timeout_handler(struct work_struct *work) /* If failing engine, trigger recovery */ failing_ch = gk20a_channel_get(&g->fifo.channel[id]); if (!failing_ch) - goto fail_enable_engine_activity; + goto fail_enable_ctxsw; if (failing_ch->hw_chid != ch->hw_chid) gk20a_channel_timeout_start(ch, job); @@ -1710,8 +1710,8 @@ static void gk20a_channel_timeout_handler(struct work_struct *work) gk20a_channel_put(failing_ch); } -fail_enable_engine_activity: - gk20a_fifo_enable_all_engine_activity(g); +fail_enable_ctxsw: + gr_gk20a_enable_ctxsw(g); fail_unlock: mutex_unlock(&g->ch_wdt_lock); gk20a_channel_put(ch); -- cgit v1.2.2