Skip to content

Commit 4d2ccd9

Browse files
ChristianKoenigAMDalexdeucher
authored andcommitted
drm/amdgpu: WARN when freeing kernel memory during suspend
When buffers are freed during suspend there is no guarantee that they can be re-allocated during resume. The PSP subsystem seems to be quite buggy regarding this, so add a WARN_ON() to point out those bugs. Signed-off-by: Christian König <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Tested-by: Guilherme G. Piccoli <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 9c3db58 commit 4d2ccd9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,8 @@ void amdgpu_bo_free_kernel(struct amdgpu_bo **bo, u64 *gpu_addr,
422422
if (*bo == NULL)
423423
return;
424424

425+
WARN_ON(amdgpu_ttm_adev((*bo)->tbo.bdev)->in_suspend);
426+
425427
if (likely(amdgpu_bo_reserve(*bo, true) == 0)) {
426428
if (cpu_addr)
427429
amdgpu_bo_kunmap(*bo);

0 commit comments

Comments
 (0)