drm/amdgpu/umsch: don't execute umsch test when GPU is in reset/suspend
authorLang Yu <Lang.Yu@amd.com>
Fri, 19 Apr 2024 07:40:08 +0000 (15:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Apr 2024 03:23:28 +0000 (23:23 -0400)
umsch test needs full GPU functionality(e.g., VM update, TLB flush,
possibly buffer moving under memory pressure) which may be not ready
under these states. Just skip it to avoid potential issues.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_umsch_mm.c

index 0df97c3e3a700dccc7bc84d4688e1dc8e1b8a1e2..f7c73533e336fac3358c58e387cb27e102ac2684 100644 (file)
@@ -774,6 +774,9 @@ static int umsch_mm_late_init(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
+       if (amdgpu_in_reset(adev) || adev->in_s0ix || adev->in_suspend)
+               return 0;
+
        return umsch_mm_test(adev);
 }