Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit bb21700

Browse files
arunpravin24airlied
authored andcommitted
drm/buddy: Fix the range bias clear memory allocation issue
Problem statement: During the system boot time, an application request for the bulk volume of cleared range bias memory when the clear_avail is zero, we dont fallback into normal allocation method as we had an unnecessary clear_avail check which prevents the fallback method leads to fb allocation failure following system goes into unresponsive state. Solution: Remove the unnecessary clear_avail check in the range bias allocation function. v2: add a kunit for this corner case (Daniel Vetter) Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com> Fixes: 9695092 ("drm/buddy: Implement tracking clear page feature") Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240514145636.16253-1-Arunpravin.PaneerSelvam@amd.com
1 parent 275654c commit bb21700

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/drm_buddy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ int drm_buddy_init(struct drm_buddy *mm, u64 size, u64 chunk_size)
249249

250250
mm->size = size;
251251
mm->avail = size;
252+
mm->clear_avail = 0;
252253
mm->chunk_size = chunk_size;
253254
mm->max_order = ilog2(size) - ilog2(chunk_size);
254255

@@ -574,7 +575,7 @@ __drm_buddy_alloc_range_bias(struct drm_buddy *mm,
574575

575576
block = __alloc_range_bias(mm, start, end, order,
576577
flags, fallback);
577-
if (IS_ERR(block) && mm->clear_avail)
578+
if (IS_ERR(block))
578579
return __alloc_range_bias(mm, start, end, order,
579580
flags, !fallback);
580581

0 commit comments

Comments
 (0)