[PATCH 13/13] drm/amdgpu: fix sched deadoff

Chunming Zhou David1.Zhou at amd.com
Mon Jul 25 07:22:33 UTC 2016


fence_wait in run_job could block scheduler, and the fence itself is
belonged to this scheduler.

Change-Id: I0c69224de5ef1bdb5b0691d668d786858155fe15
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
index df8b6e0..48c7f1b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
@@ -152,6 +152,10 @@ static struct fence *amdgpu_job_dependency(struct amd_sched_job *sched_job)
 		fence = amdgpu_sync_get_fence(&job->sync);
 	}
 
+	if (fence == NULL && vm && vm->recover_pt_fence &&
+	    !fence_is_signaled(vm->recover_pt_fence))
+		fence = vm->recover_pt_fence;
+
 	return fence;
 }
 
@@ -171,14 +175,6 @@ static struct fence *amdgpu_job_run(struct amd_sched_job *sched_job)
 
 	trace_amdgpu_sched_run_job(job);
 
-	if (job->vm && job->vm->recover_pt_fence) {
-		signed long r;
-		r = fence_wait_timeout(job->vm->recover_pt_fence, true,
-				       MAX_SCHEDULE_TIMEOUT);
-		if (r < 0)
-			DRM_ERROR("Error (%ld) waiting for fence!\n", r);
-	}
-
 	r = amdgpu_ib_schedule(job->ring, job->num_ibs, job->ibs,
 			       job->sync.last_vm_update, job, &fence);
 	if (r) {
-- 
1.9.1



More information about the amd-gfx mailing list