summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/fifo/channel.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/fifo/channel.c')
-rw-r--r--drivers/gpu/nvgpu/common/fifo/channel.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/fifo/channel.c b/drivers/gpu/nvgpu/common/fifo/channel.c
index d30b8ded..4bea032a 100644
--- a/drivers/gpu/nvgpu/common/fifo/channel.c
+++ b/drivers/gpu/nvgpu/common/fifo/channel.c
@@ -308,6 +308,7 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
308 struct dbg_session_data *session_data, *tmp_s; 308 struct dbg_session_data *session_data, *tmp_s;
309 struct dbg_session_channel_data *ch_data, *tmp; 309 struct dbg_session_channel_data *ch_data, *tmp;
310 int err; 310 int err;
311 bool deferred_reset_pending;
311 312
312 nvgpu_log_fn(g, " "); 313 nvgpu_log_fn(g, " ");
313 314
@@ -381,17 +382,17 @@ static void gk20a_free_channel(struct channel_gk20a *ch, bool force)
381 382
382 /* if engine reset was deferred, perform it now */ 383 /* if engine reset was deferred, perform it now */
383 nvgpu_mutex_acquire(&f->deferred_reset_mutex); 384 nvgpu_mutex_acquire(&f->deferred_reset_mutex);
384 if (g->fifo.deferred_reset_pending) { 385 deferred_reset_pending = g->fifo.deferred_reset_pending;
386 nvgpu_mutex_release(&f->deferred_reset_mutex);
387
388 if (deferred_reset_pending) {
385 nvgpu_log(g, gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was" 389 nvgpu_log(g, gpu_dbg_intr | gpu_dbg_gpu_dbg, "engine reset was"
386 " deferred, running now"); 390 " deferred, running now");
387 /* if lock is already taken, a reset is taking place 391 nvgpu_mutex_acquire(&g->fifo.engines_reset_mutex);
388 so no need to repeat */ 392 gk20a_fifo_deferred_reset(g, ch);
389 if (nvgpu_mutex_tryacquire(&g->fifo.gr_reset_mutex)) { 393 nvgpu_mutex_release(&g->fifo.engines_reset_mutex);
390 gk20a_fifo_deferred_reset(g, ch);
391 nvgpu_mutex_release(&g->fifo.gr_reset_mutex);
392 }
393 } 394 }
394 nvgpu_mutex_release(&f->deferred_reset_mutex); 395
395 396
396 if (!gk20a_channel_as_bound(ch)) { 397 if (!gk20a_channel_as_bound(ch)) {
397 goto unbind; 398 goto unbind;