drm/amdgpu:use job's list instead of check fence
authorMonk Liu <Monk.Liu@amd.com>
Thu, 11 May 2017 05:59:15 +0000 (13:59 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:40:41 +0000 (17:40 -0400)
because if the fence is really signaled, it could already
released so the fence pointer is a wild pointer, but if
we use job->base.node we are safe because job will not
be released untill amdgpu_job_timedout finished.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 8b0f4864a88514800b64d8b65e0863657661af95..d1385eba6f43b339024b85e7756e68ae0294cb7c 100644 (file)
@@ -2644,9 +2644,9 @@ int amdgpu_sriov_gpu_reset(struct amdgpu_device *adev, struct amdgpu_job *job)
                if (job && j != i)
                        continue;
 
-               /* here give the last chance to check if fence signaled
+               /* here give the last chance to check if job removed from mirror-list
                 * since we already pay some time on kthread_park */
-               if (job && dma_fence_is_signaled(&job->base.s_fence->finished)) {
+               if (job && list_empty(&job->base.node)) {
                        kthread_unpark(ring->sched.thread);
                        goto give_up_reset;
                }