[PATCH 05/12] drm/amdgpu: block ttm first before parking scheduler

Chunming Zhou David1.Zhou at amd.com
Thu Jun 30 09:34:37 UTC 2016


Change-Id: I6122248dca518afe5ea05d611eb09116631670bd
Signed-off-by: Chunming Zhou <David1.Zhou at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 742ad22..f71db10 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1943,6 +1943,9 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 	atomic_inc(&adev->gpu_reset_counter);
 	atomic_set(&adev->is_gpu_reset, 1);
 
+	/* block TTM */
+	resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
+
 	/* block scheduler */
 	for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
 		struct amdgpu_ring *ring = adev->rings[i];
@@ -1954,8 +1957,6 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 		amd_sched_hw_job_reset(&ring->sched);
 	}
 
-	/* block TTM */
-	resched = ttm_bo_lock_delayed_workqueue(&adev->mman.bdev);
 	/* store modesetting */
 	if (amdgpu_device_has_dal_support(adev))
 		state = drm_atomic_helper_suspend(adev->ddev);
-- 
1.9.1



More information about the amd-gfx mailing list