drm/amdgpu: adjust the sequence to check soft reset
authorLikun Gao <Likun.Gao@amd.com>
Wed, 21 Dec 2022 05:46:33 +0000 (13:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 3 Jan 2023 21:49:26 +0000 (16:49 -0500)
1.Drop soft reset check when do should recover gpu check.
  (As it will skip gpu reset operation if some ip is hang but
   not support soft reset)
2.Check soft reset status before do soft reset when pre asic reset.
  a. If check soft reset return true, it means: some ip is hang and
     it also support soft reset, will try soft reset first.
  b. If check soft reset return false, it means:
       I.  All the ip are not hang, will skip gpu reset.
       II. Some ip is hang but not support soft reset, will skip soft
           reset and retry with full reset later.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index e4609b8d574c42ef1753a54914a4f1246b2af26b..89e09f0f3c7bac0a5eed8b22a79b543fcf3833d5 100644 (file)
@@ -4602,11 +4602,6 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev)
        if (!amdgpu_ras_is_poison_mode_supported(adev))
                return true;
 
-       if (!amdgpu_device_ip_check_soft_reset(adev)) {
-               dev_info(adev->dev,"Timeout, but no hardware hang detected.\n");
-               return false;
-       }
-
        if (amdgpu_sriov_vf(adev))
                return true;
 
@@ -4731,7 +4726,8 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev,
                if (!need_full_reset)
                        need_full_reset = amdgpu_device_ip_need_full_reset(adev);
 
-               if (!need_full_reset && amdgpu_gpu_recovery) {
+               if (!need_full_reset && amdgpu_gpu_recovery &&
+                   amdgpu_device_ip_check_soft_reset(adev)) {
                        amdgpu_device_ip_pre_soft_reset(adev);
                        r = amdgpu_device_ip_soft_reset(adev);
                        amdgpu_device_ip_post_soft_reset(adev);