]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/buddy: Fix alloc_range() error handling code
authorArunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Wed, 14 Feb 2024 13:18:52 +0000 (18:48 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Feb 2024 08:51:45 +0000 (09:51 +0100)
commit4b59c3fada06e5e8010ef7700689c71986e667a2
tree74944182c1c6547a664738e138bc03a36e7f9342
parent6190d4c08897d748dd25f0b78267a90aa1694e15
drm/buddy: Fix alloc_range() error handling code

commit 8746c6c9dfa31d269c65dd52ab42fde0720b7d91 upstream.

Few users have observed display corruption when they boot
the machine to KDE Plasma or playing games. We have root
caused the problem that whenever alloc_range() couldn't
find the required memory blocks the function was returning
SUCCESS in some of the corner cases.

The right approach would be if the total allocated size
is less than the required size, the function should
return -ENOSPC.

Cc: <stable@vger.kernel.org> # 6.7+
Fixes: 0a1844bf0b53 ("drm/buddy: Improve contiguous memory allocation")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3097
Tested-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240207174456.341121-1-Arunpravin.PaneerSelvam@amd.com/
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240214131853.5934-1-Arunpravin.PaneerSelvam@amd.com
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_buddy.c