Skip to content

Commit 31849bf

Browse files
committed
drm/amdgpu: Fix the BO release clear memory warning
This happens when the amdgpu_bo_release_notify running before amdgpu_ttm_set_buffer_funcs_status set the buffer funcs to enabled. check the buffer funcs enablement before calling the fill buffer memory. v2:(Christian) - Apply it only for GEM buffers and since GEM buffers are only allocated/freed while the driver is loaded we never run into the issue to clear with buffer funcs disabled. v3:(Mario) - drop the stable tag as this will presumably go into a -fixes PR for 6.10 Log snip: *ERROR* Trying to clear memory with ring turned off. RIP: 0010:amdgpu_bo_release_notify+0x201/0x220 [amdgpu] Fixes: a68c7ea ("drm/amdgpu: Enable clear page functionality") Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Tested-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com> Tested-by: Richard Gong <richard.gong@amd.com> Suggested-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240610180401.9540-1-Arunpravin.PaneerSelvam@amd.com
1 parent ce62600 commit 31849bf

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
108108

109109
memset(&bp, 0, sizeof(bp));
110110
*obj = NULL;
111+
flags |= AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE;
111112

112113
bp.size = size;
113114
bp.byte_align = alignment;

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,6 @@ int amdgpu_bo_create(struct amdgpu_device *adev,
604604
if (!amdgpu_bo_support_uswc(bo->flags))
605605
bo->flags &= ~AMDGPU_GEM_CREATE_CPU_GTT_USWC;
606606

607-
bo->flags |= AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE;
608-
609607
bo->tbo.bdev = &adev->mman.bdev;
610608
if (bp->domain & (AMDGPU_GEM_DOMAIN_GWS | AMDGPU_GEM_DOMAIN_OA |
611609
AMDGPU_GEM_DOMAIN_GDS))

0 commit comments

Comments
 (0)