drm/amdgpu: move mes self test after drm sched re-started
authorJack Xiao <Jack.Xiao@amd.com>
Wed, 20 Jul 2022 07:57:22 +0000 (15:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 28 Jul 2022 20:28:54 +0000 (16:28 -0400)
mes self test rely on vm mapping, move it after
drm sched re-started so that vm mapping can work
during gpu reset.

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Acked-and-tested-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/mes_v10_1.c
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

index 16b4f99360cd7e6b6982693b3b54845f4499f571..c4a6fe3070b6e6e34bae181abcfb6a86c421f171 100644 (file)
@@ -5299,6 +5299,9 @@ skip_hw_reset:
                        drm_sched_start(&ring->sched, !tmp_adev->asic_reset_res);
                }
 
+               if (adev->enable_mes)
+                       amdgpu_mes_self_test(tmp_adev);
+
                if (!drm_drv_uses_atomic_modeset(adev_to_drm(tmp_adev)) && !job_signaled) {
                        drm_helper_resume_force_mode(adev_to_drm(tmp_adev));
                }
index 0082e2e1e0b470c0ae8c3edd4d5a3acc0757f3de..067d10073a562c65682d048cd5d0beadbf2a79a4 100644 (file)
@@ -1233,7 +1233,8 @@ static int mes_v10_0_late_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-       amdgpu_mes_self_test(adev);
+       if (!amdgpu_in_reset(adev))
+               amdgpu_mes_self_test(adev);
 
        return 0;
 }
index 777f9268d92d652d55d9482c31e5daf797d85b33..120ea294abefb71352d73e44b9be9418599385d3 100644 (file)
@@ -1280,7 +1280,8 @@ static int mes_v11_0_late_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-       amdgpu_mes_self_test(adev);
+       if (!amdgpu_in_reset(adev))
+               amdgpu_mes_self_test(adev);
 
        return 0;
 }