aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
diff options
context:
space:
mode:
authorYiPeng Chai <[email protected]>2025-08-12 01:17:58 +0000
committerAlex Deucher <[email protected]>2025-08-12 20:07:45 +0000
commit10ef476aad1c848449934e7bec2ab2374333c7b6 (patch)
tree49d44bbc8b8cb1af52ab284b276ac59f37bd8644 /drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
parentdrm/amdgpu: Add PSP fw version check for fw reserve GFX command (diff)
downloadkernel-10ef476aad1c848449934e7bec2ab2374333c7b6.tar.gz
kernel-10ef476aad1c848449934e7bec2ab2374333c7b6.zip
drm/amdgpu: fix vram reservation issue
The vram block allocation flag must be cleared before making vram reservation, otherwise reserving addresses within the currently freed memory range will always fail. Fixes: c9cad937c0c5 ("drm/amdgpu: add drm buddy support to amdgpu") Signed-off-by: YiPeng Chai <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit d38eaf27de1b8584f42d6fb3f717b7ec44b3a7a1)
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
index 07c936e90d8e..78f9e86ccc09 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -648,9 +648,8 @@ static void amdgpu_vram_mgr_del(struct ttm_resource_manager *man,
list_for_each_entry(block, &vres->blocks, link)
vis_usage += amdgpu_vram_mgr_vis_size(adev, block);
- amdgpu_vram_mgr_do_reserve(man);
-
drm_buddy_free_list(mm, &vres->blocks, vres->flags);
+ amdgpu_vram_mgr_do_reserve(man);
mutex_unlock(&mgr->lock);
atomic64_sub(vis_usage, &mgr->vis_usage);