[PATCH 06/12] drm/amdgpu: force completion for gpu reset

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


After all hw jobs are reset, hw fence is meanless, so force_completion

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

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index f71db10..a3ca83f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1956,7 +1956,8 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
 		kthread_park(ring->sched.thread);
 		amd_sched_hw_job_reset(&ring->sched);
 	}
-
+	/* after all hw jobs are reset, hw fence is meanless, so force_completion */
+	amdgpu_fence_driver_force_completion(adev);
 	/* store modesetting */
 	if (amdgpu_device_has_dal_support(adev))
 		state = drm_atomic_helper_suspend(adev->ddev);
@@ -1996,7 +1997,7 @@ retry:
 	}
 	/* restore scratch */
 	amdgpu_atombios_scratch_regs_restore(adev);
-	if (0) {
+	if (!r) {
 		for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
 			struct amdgpu_ring *ring = adev->rings[i];
 			if (!ring)
@@ -2017,7 +2018,7 @@ retry:
 			}
 		}
 	} else {
-		amdgpu_fence_driver_force_completion(adev);
+		dev_err(adev->dev, "asic resume failed (%d).\n", r);
 		for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
 			if (adev->rings[i]) {
 				kthread_unpark(adev->rings[i]->sched.thread);
-- 
1.9.1



More information about the amd-gfx mailing list