Skip to content

Commit d4364ec

Browse files
superm1antheas
authored andcommitted
drm/amd: Use suspend and hibernate post freeze notifications
commit 2965e63 ("drm/amd: Add Suspend/Hibernate notification callback support") introduced a VRAM eviction earlier in the PM sequences when swap was still available for evicting to. This helped to fix a number of memory pressure related bugs but also exposed a new one. If a userspace process is actively using the GPU when suspend starts then a deadlock could occur. Instead of going off the prepare notifier, use the PM notifiers that occur after processes have been frozen to do evictions. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4178 Fixes: 2965e63 ("drm/amd: Add Suspend/Hibernate notification callback support") Signed-off-by: Mario Limonciello <[email protected]>
1 parent 5a8142e commit d4364ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4842,10 +4842,10 @@ static int amdgpu_device_pm_notifier(struct notifier_block *nb, unsigned long mo
48424842
int r;
48434843

48444844
switch (mode) {
4845-
case PM_HIBERNATION_PREPARE:
4845+
case PM_HIBERNATION_POST_FREEZE:
48464846
adev->in_s4 = true;
48474847
fallthrough;
4848-
case PM_SUSPEND_PREPARE:
4848+
case PM_SUSPEND_POST_FREEZE:
48494849
r = amdgpu_device_evict_resources(adev);
48504850
/*
48514851
* This is considered non-fatal at this time because

0 commit comments

Comments
 (0)