drm/amd/amdgpu: fix warning during suspend
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 10 Feb 2023 02:31:32 +0000 (10:31 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Feb 2023 03:46:04 +0000 (22:46 -0500)
Freeing memory was warned during suspend.
Move the self test out of suspend.

Link: https://bugzilla.redhat.com/show_bug.cgi?id=2151825
Cc: jfalempe@redhat.com
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-and-tested-by: Evan Quan <evan.quan@amd.com>
Tested-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.1.x
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c

index 2f28a8c02f6412b687c7b5cace7bc670df352410..fbf2f24169eb5f9accc46796872ae6f8f54440f4 100644 (file)
@@ -4268,6 +4268,9 @@ exit:
        }
        adev->in_suspend = false;
 
+       if (adev->enable_mes)
+               amdgpu_mes_self_test(adev);
+
        if (amdgpu_acpi_smart_shift_update(dev, AMDGPU_SS_DEV_D0))
                DRM_WARN("smart shift update failed\n");
 
index 5dff79e8f3011010c85622a31bb48b1dc9453092..1c4787000a5f392e08018e9ac5d27d363cc7dc85 100644 (file)
@@ -1344,7 +1344,7 @@ static int mes_v11_0_late_init(void *handle)
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
        /* it's only intended for use in mes_self_test case, not for s0ix and reset */
-       if (!amdgpu_in_reset(adev) && !adev->in_s0ix &&
+       if (!amdgpu_in_reset(adev) && !adev->in_s0ix && !adev->in_suspend &&
            (adev->ip_versions[GC_HWIP][0] != IP_VERSION(11, 0, 3)))
                amdgpu_mes_self_test(adev);