drm/amd: Stop evicting resources on APUs in suspend
authorMario Limonciello <mario.limonciello@amd.com>
Thu, 8 Feb 2024 05:52:55 +0000 (23:52 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 13 Feb 2024 13:59:49 +0000 (08:59 -0500)
commit226db36032c61d8717dfdd052adac351b22d3e83
tree1c2563ec9ac213f58f356aa8e4d5ef1be408521a
parentddc23e6e230e9ba50fda44fe680907c6ce4cd1df
drm/amd: Stop evicting resources on APUs in suspend

commit 5095d5418193 ("drm/amd: Evict resources during PM ops prepare()
callback") intentionally moved the eviction of resources to earlier in
the suspend process, but this introduced a subtle change that it occurs
before adev->in_s0ix or adev->in_s3 are set. This meant that APUs
actually started to evict resources at suspend time as well.

Explicitly set s0ix or s3 in the prepare() stage, and unset them if the
prepare() stage failed.

v2: squash in warning fix from Stephen Rothwell

Reported-by: Jürg Billeter <j@bitron.ch>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3132#note_2271038
Fixes: 5095d5418193 ("drm/amd: Evict resources during PM ops prepare() callback")
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c