[AMD Official Use Only - AMD Internal Distribution Only]

Reviewed-by: Hawking Zhang <[email protected]>

Regards,
Hawking
-----Original Message-----
From: Chai, Thomas <[email protected]>
Sent: Tuesday, August 12, 2025 10:00
To: [email protected]
Cc: Chai, Thomas <[email protected]>; Zhang, Hawking <[email protected]>; 
Zhou1, Tao <[email protected]>; Yang, Stanley <[email protected]>; Chai, 
Thomas <[email protected]>
Subject: [PATCH] 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.

Signed-off-by: YiPeng Chai <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 3 +--
 1 file changed, 1 insertion(+), 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 77ce9cf28051..e69db0a93378 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
@@ -685,9 +685,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);
--
2.34.1

Reply via email to