Skip to content

Commit f7d6779

Browse files
Guchun Chenalexdeucher
authored andcommitted
drm/amdgpu: stop scheduler when calling hw_fini (v2)
This gurantees no more work on the ring can be submitted to hardware in suspend/resume case, otherwise a potential race will occur and the ring will get no chance to stay empty before suspend. v2: Call drm_sched_resubmit_job before drm_sched_start to restart jobs from the pending list. Suggested-by: Andrey Grodzovsky <[email protected]> Suggested-by: Christian König <[email protected]> Signed-off-by: Guchun Chen <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 156872b commit f7d6779

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ void amdgpu_fence_driver_hw_fini(struct amdgpu_device *adev)
552552
if (!ring || !ring->fence_drv.initialized)
553553
continue;
554554

555+
if (!ring->no_scheduler)
556+
drm_sched_stop(&ring->sched, NULL);
557+
555558
/* You can't wait for HW to signal if it's gone */
556559
if (!drm_dev_is_unplugged(&adev->ddev))
557560
r = amdgpu_fence_wait_empty(ring);
@@ -611,6 +614,11 @@ void amdgpu_fence_driver_hw_init(struct amdgpu_device *adev)
611614
if (!ring || !ring->fence_drv.initialized)
612615
continue;
613616

617+
if (!ring->no_scheduler) {
618+
drm_sched_resubmit_jobs(&ring->sched);
619+
drm_sched_start(&ring->sched, true);
620+
}
621+
614622
/* enable the interrupt */
615623
if (ring->fence_drv.irq_src)
616624
amdgpu_irq_get(adev, ring->fence_drv.irq_src,

0 commit comments

Comments
 (0)