drm/amdgpu: Skip ring soft recovery when fence was NULL
authorwentalou <Wentao.Lou@amd.com>
Thu, 6 Dec 2018 02:29:52 +0000 (10:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 7 Dec 2018 22:53:47 +0000 (17:53 -0500)
amdgpu_ring_soft_recovery would have Call-Trace,
when s_fence->parent was NULL inside amdgpu_job_timedout.
Check fence first, as drm_sched_hw_job_reset did.

Signed-off-by: Wentao Lou <Wentao.Lou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c

index 5b75bdc8dc28f673957067f36268ea7fb6eae8e1..335a0edf114b6d313091df85ed150782238c0a64 100644 (file)
@@ -397,7 +397,7 @@ bool amdgpu_ring_soft_recovery(struct amdgpu_ring *ring, unsigned int vmid,
 {
        ktime_t deadline = ktime_add_us(ktime_get(), 10000);
 
-       if (!ring->funcs->soft_recovery)
+       if (!ring->funcs->soft_recovery || !fence)
                return false;
 
        atomic_inc(&ring->adev->gpu_reset_counter);