Skip to contentSkip to conversation

drm/amdgpu: fix suspend/resume hang regression

PATCH In review Qiang Yu 2 participants 2 messages Mar 1, 2022

Subsystems (2)
lore
Share & tools
lore

Qiang Yu

author
#0 lore raw

PATCH 1/1 drm/amdgpu: fix suspend/resume hang regression

Regression has been reported that suspend/resume may hang with the previous vm ready check commit:
https://gitlab.freedesktop.org/drm/amd/-/issues/1915#note_1278198

So bring back the evicted list check as a temp fix.

Fixes cc8dd2cc1a97 ("drm/amdgpu: check vm ready by amdgpu_vm->evicting flag")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
index 2cd9f1a2e5fa..fc4563cf2828 100644
@@ -779,7 +779,8 @@ bool amdgpu_vm_ready(struct amdgpu_vm *vm)
 	amdgpu_vm_eviction_lock(vm);
 	ret = !vm->evicting;
 	amdgpu_vm_eviction_unlock(vm);
-	return ret;
+
+	return ret && list_empty(&vm->evicted);
 }
 
 /**
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Am 01.03.22 um 07:26 schrieb Qiang Yu:

Quoted 8 lines

Regression has been reported that suspend/resume may hang with the previous vm ready check commit:
https://gitlab.freedesktop.org/drm/amd/-/issues/1915#note_1278198

So bring back the evicted list check as a temp fix.

Fixes cc8dd2cc1a97 ("drm/amdgpu: check vm ready by amdgpu_vm->evicting flag")
Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +2 -1
index 2cd9f1a2e5fa..fc4563cf2828 100644
@@ -779,7 +779,8 @@ bool amdgpu_vm_ready(struct amdgpu_vm *vm)
  	amdgpu_vm_eviction_lock(vm);
  	ret = !vm->evicting;
  	amdgpu_vm_eviction_unlock(vm);
-	return ret;
+
+	return ret && list_empty(&vm->evicted);
  }
 
  /**