]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/amd: Evict resources during PM ops prepare() callback
authorMario Limonciello <mario.limonciello@amd.com>
Fri, 6 Oct 2023 18:50:20 +0000 (13:50 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:35:55 +0000 (16:35 +0200)
commit8b5f720486ca87e102ee722a73ae0894c12f1e7a
tree0630929ded370c35c5e05c71951b896b2d6353c5
parent4356a2c3f296503c8b420ae8adece053960a9f06
drm/amd: Evict resources during PM ops prepare() callback

[ Upstream commit 5095d5418193eb2748c7d8553c7150b8f1c44696 ]

Linux PM core has a prepare() callback run before suspend.

If the system is under high memory pressure, the resources may need
to be evicted into swap instead.  If the storage backing for swap
is offlined during the suspend() step then such a call may fail.

So move this step into prepare() to move evict majority of
resources and update all non-pmops callers to call the same callback.

Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2362
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-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>
Stable-dep-of: ca299b4512d4 ("drm/amd: Flush GFXOFF requests in prepare stage")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c