Skip to content

Commit 4d2f6b4

Browse files
John Olenderalexdeucher
authored andcommitted
drm/amdgpu: amdgpu_vram_mgr_new(): Clamp lpfn to total vram
The drm_mm allocator tolerated being passed end > mm->size, but the drm_buddy allocator does not. Restore the pre-buddy-allocator behavior of allowing such placements. Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3448 Signed-off-by: John Olender <john.olender@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
1 parent bf394d2 commit 4d2f6b4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static int amdgpu_vram_mgr_new(struct ttm_resource_manager *man,
463463
int r;
464464

465465
lpfn = (u64)place->lpfn << PAGE_SHIFT;
466-
if (!lpfn)
466+
if (!lpfn || lpfn > man->size)
467467
lpfn = man->size;
468468

469469
fpfn = (u64)place->fpfn << PAGE_SHIFT;

0 commit comments

Comments
 (0)