Skip to content

Commit

Permalink
drm/amdgpu: free the job immediately after dispatching it
Browse files Browse the repository at this point in the history
Fixes a whole bunch of lockdep warnings.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
  • Loading branch information
Christian König authored and Alex Deucher committed Aug 20, 2015
1 parent 2b184d8 commit bf7ebae
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ static struct fence *amdgpu_sched_run_job(struct amd_gpu_scheduler *sched,
goto err;
fence = amdgpu_fence_ref(sched_job->ibs[sched_job->num_ibs - 1].fence);

if (sched_job->free_job)
sched_job->free_job(sched_job);

mutex_unlock(&sched_job->job_lock);
return &fence->base;

Expand All @@ -69,10 +72,6 @@ static void amdgpu_sched_process_job(struct amd_gpu_scheduler *sched,
return;
}
sched_job = (struct amdgpu_job *)job;
mutex_lock(&sched_job->job_lock);
if (sched_job->free_job)
sched_job->free_job(sched_job);
mutex_unlock(&sched_job->job_lock);
/* after processing job, free memory */
fence_put(&sched_job->base.s_fence->base);
kfree(sched_job);
Expand Down

0 comments on commit bf7ebae

Please sign in to comment.