From 085b89278f296c40e86f5d1e1bcc1017c39f4002 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 16 May 2024 09:46:37 +1000 Subject: [PATCH] drm/buddy: convert WARN_ON to an if + continue This WARN_ON triggers a lot, but I don't think the __force_merge path always has to succeed, so just return a failure here instead of warn on to let other paths handle the allocation. (Not 100% sure on this patch - airlied). --- drivers/gpu/drm/drm_buddy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c index 284ebae71cc4..6b90ec6eefa8 100644 --- a/drivers/gpu/drm/drm_buddy.c +++ b/drivers/gpu/drm/drm_buddy.c @@ -195,8 +195,9 @@ static int __force_merge(struct drm_buddy *mm, if (!drm_buddy_block_is_free(buddy)) continue; - WARN_ON(drm_buddy_block_is_clear(block) == - drm_buddy_block_is_clear(buddy)); + if (drm_buddy_block_is_clear(block) != + drm_buddy_block_is_clear(buddy)) + continue; /* * If the prev block is same as buddy, don't access the -- 2.44.0