summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 8a9729ab..73cc18d2 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -2658,6 +2658,14 @@ static void gk20a_channel_clean_up_jobs(struct channel_gk20a *c,
2658 gk20a_vm_put_buffers(vm, job->mapped_buffers, 2658 gk20a_vm_put_buffers(vm, job->mapped_buffers,
2659 job->num_mapped_buffers); 2659 job->num_mapped_buffers);
2660 2660
2661 /* Remove job from channel's job list before we close the
2662 * fences, to prevent other callers (gk20a_channel_abort) from
2663 * trying to dereference post_fence when it no longer exists.
2664 */
2665 channel_gk20a_joblist_lock(c);
2666 channel_gk20a_joblist_delete(c, job);
2667 channel_gk20a_joblist_unlock(c);
2668
2661 /* Close the fences (this will unref the semaphores and release 2669 /* Close the fences (this will unref the semaphores and release
2662 * them to the pool). */ 2670 * them to the pool). */
2663 gk20a_fence_put(job->pre_fence); 2671 gk20a_fence_put(job->pre_fence);
@@ -2673,13 +2681,10 @@ static void gk20a_channel_clean_up_jobs(struct channel_gk20a *c,
2673 gk20a_channel_put(c); 2681 gk20a_channel_put(c);
2674 2682
2675 /* 2683 /*
2676 * ensure all pending writes complete before deleting the node. 2684 * ensure all pending writes complete before freeing up the job.
2677 * see corresponding rmb in channel_gk20a_alloc_job(). 2685 * see corresponding rmb in channel_gk20a_alloc_job().
2678 */ 2686 */
2679 wmb(); 2687 wmb();
2680 channel_gk20a_joblist_lock(c);
2681 channel_gk20a_joblist_delete(c, job);
2682 channel_gk20a_joblist_unlock(c);
2683 2688
2684 channel_gk20a_free_job(c, job); 2689 channel_gk20a_free_job(c, job);
2685 job_finished = 1; 2690 job_finished = 1;