Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe: Fix stolen size check to allow equal WOPCM size

On some platforms without dedicated stolen memory, the calculated
stolen size may be exactly equal to the WOPCM size. The current
assertion incorrectly requires it to be strictly greater, causing
a false failure. Relax the check to allow equality.

Fixes: 65369b8e2961 ("drm/xe: Change return type of detect_bar2_dgfx() from s64 to u64")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6359
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/20251016225506.2256127-2-shuicheng.lin@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

authored by

Shuicheng Lin and committed by
Rodrigo Vivi
2a407bc3 beaae3c0

+1 -1
+1 -1
drivers/gpu/drm/xe/xe_ttm_stolen_mgr.c
··· 106 106 107 107 stolen_size = tile_size - mgr->stolen_base; 108 108 109 - xe_assert(xe, stolen_size > wopcm_size); 109 + xe_assert(xe, stolen_size >= wopcm_size); 110 110 stolen_size -= wopcm_size; 111 111 112 112 /* Verify usage fits in the actual resource available */