mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 02:02:28 +09:00
drm/i915/buddy: tweak 2big check
Otherwise we get -EINVAL, instead of the more useful -E2BIG if the allocation doesn't fit within the pfn range, like with mappable lmem. The hugepages selftest, for example, needs this to know if a smaller size is needed. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> Acked-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220225145502.331818-6-matthew.auld@intel.com
This commit is contained in:
@@ -82,7 +82,7 @@ static int i915_ttm_buddy_man_alloc(struct ttm_resource_manager *man,
|
||||
lpfn = pages;
|
||||
}
|
||||
|
||||
if (size > mm->size) {
|
||||
if (size > lpfn << PAGE_SHIFT) {
|
||||
err = -E2BIG;
|
||||
goto err_free_res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user