]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd: Avoid evicting resources at S5
authorMario Limonciello (AMD) <superm1@kernel.org>
Mon, 11 Aug 2025 17:00:06 +0000 (12:00 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:24 +0000 (15:34 -0500)
[ Upstream commit 531df041f2a5296174abd8292d298eb62fe1ea97 ]

Normally resources are evicted on dGPUs at suspend or hibernate and
on APUs at hibernate.  These steps are unnecessary when using the S4
callbacks to put the system into S5.

Cc: AceLan Kao <acelan.kao@canonical.com>
Cc: Kai-Heng Feng <kaihengf@nvidia.com>
Cc: Mark Pearson <mpearson-lenovo@squebb.ca>
Cc: Denis Benato <benato.denis96@gmail.com>
Cc: Merthan Karakaş <m3rthn.k@gmail.com>
Tested-by: Eric Naim <dnaim@cachyos.org>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

index 7ff81bd1ec20018dcc16c6dc797405dbcfa72cb8..7a8a53fbe918c8db4ce88819d743adb036da20c6 100644 (file)
@@ -4731,6 +4731,10 @@ static int amdgpu_device_evict_resources(struct amdgpu_device *adev)
        if ((adev->in_s3 || adev->in_s0ix) && (adev->flags & AMD_IS_APU))
                return 0;
 
+       /* No need to evict when going to S5 through S4 callbacks */
+       if (system_state == SYSTEM_POWER_OFF)
+               return 0;
+
        ret = amdgpu_ttm_evict_resources(adev, TTM_PL_VRAM);
        if (ret)
                DRM_WARN("evicting device resources failed\n");