Skip to contentSkip to conversation

drm/amdgpu: Fix the lpfn checking condition in drm buddy

PATCH In review Ma Jun 2 participants 2 messages Sep 14, 2022

Subsystems (2)
lore
Share & tools
lore

Ma Jun

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Fix the lpfn checking condition in drm buddy

Because the value of man->size is changed during suspend/resume process, use mgr->mm.size instead of man->size here for lpfn checking.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +1 -1
index 48e3dc28b156..0b598b510bd8 100644
@@ -441,7 +441,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
 	if (place->flags & TTM_PL_FLAG_TOPDOWN)
 		vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
 
-	if (fpfn || lpfn != man->size)
+	if (fpfn || lpfn != mgr->mm.size)
 		/* Allocate blocks in desired range */
 		vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;
 
Signature · 1 line
2.25.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 14.09.22 um 14:53 schrieb Ma Jun:

Quoted 5 lines

Because the value of man->size is changed during suspend/resume process, use mgr->mm.size instead of man->size here for lpfn checking.

Quoted 17 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +1 -1
index 48e3dc28b156..0b598b510bd8 100644
@@ -441,7 +441,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
  	if (place->flags & TTM_PL_FLAG_TOPDOWN)
  		vres->flags |= DRM_BUDDY_TOPDOWN_ALLOCATION;
 
-	if (fpfn || lpfn != man->size)
+	if (fpfn || lpfn != mgr->mm.size)
  		/* Allocate blocks in desired range */
  		vres->flags |= DRM_BUDDY_RANGE_ALLOCATION;