OSDN Git Service

drm/amdgpu/fence: Fix oops due to non-matching drm_sched init/fini
[tomoyo/tomoyo-test1.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_fence.c
index 0044420..faff4a3 100644 (file)
@@ -618,7 +618,13 @@ void amdgpu_fence_driver_sw_fini(struct amdgpu_device *adev)
                if (!ring || !ring->fence_drv.initialized)
                        continue;
 
-               if (!ring->no_scheduler)
+               /*
+                * Notice we check for sched.ops since there's some
+                * override on the meaning of sched.ready by amdgpu.
+                * The natural check would be sched.ready, which is
+                * set as drm_sched_init() finishes...
+                */
+               if (ring->sched.ops)
                        drm_sched_fini(&ring->sched);
 
                for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j)