diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index dae9c8cb..c18a4e5d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -719,7 +719,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch) | |||
719 | struct vm_gk20a *ch_vm = ch->vm; | 719 | struct vm_gk20a *ch_vm = ch->vm; |
720 | unsigned long timeout = gk20a_get_gr_idle_timeout(g); | 720 | unsigned long timeout = gk20a_get_gr_idle_timeout(g); |
721 | struct dbg_session_gk20a *dbg_s; | 721 | struct dbg_session_gk20a *dbg_s; |
722 | 722 | bool was_reset; | |
723 | gk20a_dbg_fn(""); | 723 | gk20a_dbg_fn(""); |
724 | 724 | ||
725 | WARN_ON(ch->g == NULL); | 725 | WARN_ON(ch->g == NULL); |
@@ -764,7 +764,15 @@ static void gk20a_free_channel(struct channel_gk20a *ch) | |||
764 | if (g->fifo.deferred_reset_pending) { | 764 | if (g->fifo.deferred_reset_pending) { |
765 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" | 765 | gk20a_dbg(gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" |
766 | " deferred, running now"); | 766 | " deferred, running now"); |
767 | gk20a_fifo_reset_engine(g, g->fifo.deferred_fault_engines); | 767 | was_reset = mutex_is_locked(&g->fifo.gr_reset_mutex); |
768 | mutex_lock(&g->fifo.gr_reset_mutex); | ||
769 | /* if lock is already taken, a reset is taking place | ||
770 | so no need to repeat */ | ||
771 | if (!was_reset) { | ||
772 | gk20a_fifo_reset_engine(g, | ||
773 | g->fifo.deferred_fault_engines); | ||
774 | } | ||
775 | mutex_unlock(&g->fifo.gr_reset_mutex); | ||
768 | g->fifo.deferred_fault_engines = 0; | 776 | g->fifo.deferred_fault_engines = 0; |
769 | g->fifo.deferred_reset_pending = false; | 777 | g->fifo.deferred_reset_pending = false; |
770 | } | 778 | } |