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

drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible

It incorrectly claimed a resource isn't CPU visible if it's located at
the very end of CPU visible VRAM.

Fixes: a6ff969fe9cb ("drm/amdgpu: fix visible VRAM handling during faults")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3343
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reported-and-Tested-by: Jeremy Day <jsday@noreason.ca>
Signed-off-by: Michel Dänzer <mdaenzer@redhat.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: stable@vger.kernel.org

authored by

Michel Dänzer and committed by
Alex Deucher
c4dcb47d e35ba81b

+1 -1
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 432 432 433 433 amdgpu_res_first(res, 0, res->size, &cursor); 434 434 while (cursor.remaining) { 435 - if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size) 435 + if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size) 436 436 return false; 437 437 amdgpu_res_next(&cursor, cursor.size); 438 438 }