drm/amd/amdgpu: fix warning during suspend
authorjsg <jsg@openbsd.org>
Thu, 23 Feb 2023 02:25:43 +0000 (02:25 +0000)
committerjsg <jsg@openbsd.org>
Thu, 23 Feb 2023 02:25:43 +0000 (02:25 +0000)
From Jack Xiao
dbe3529e816ee77a19fb6636e762b1dadbd02d10 in linux-6.1.y/6.1.13
8f32378986218812083b127da5ba42d48297d7c4 in mainline linux

sys/dev/pci/drm/amd/amdgpu/amdgpu_device.c
sys/dev/pci/drm/amd/amdgpu/mes_v11_0.c

index 432dad5..0b80179 100644 (file)
@@ -4361,6 +4361,9 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
 #endif
        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 0e92045..8ef6cbb 100644 (file)
@@ -1339,7 +1339,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);