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 <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexdeucher@amd.com> Tested-by: Guilherme G. Piccoli <gpiccoli@igalia.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 9c3db58 commit 4d2ccd9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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)