[PATCH] drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible
Christian König
christian.koenig at amd.com
Wed May 8 17:25:35 UTC 2024
Am 08.05.24 um 15:45 schrieb Alex Deucher:
> On Wed, May 8, 2024 at 9:25 AM Michel Dänzer <michel at daenzer.net> wrote:
>> From: Michel Dänzer <mdaenzer at redhat.com>
>>
>> It incorrectly claimed a resource isn't CPU visible if it's located at
>> the very end of CPU visible VRAM.
>>
>> Fixes: a6ff969fe9 ("drm/amdgpu: fix visible VRAM handling during faults")
>> Reported-and-Tested-by: Jeremy Day <jsday at noreason.ca>
>> Signed-off-by: Michel Dänzer <mdaenzer at redhat.com>
> Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Christian König <christian.koenig at amd.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3343
CC: stable at vger.kernel.org
Christian.
> and applied. Thanks!
>
> Alex
>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> index 109fe557a02b..29c197c00018 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
>> @@ -427,7 +427,7 @@ bool amdgpu_res_cpu_visible(struct amdgpu_device *adev,
>>
>> amdgpu_res_first(res, 0, res->size, &cursor);
>> while (cursor.remaining) {
>> - if ((cursor.start + cursor.size) >= adev->gmc.visible_vram_size)
>> + if ((cursor.start + cursor.size) > adev->gmc.visible_vram_size)
>> return false;
>> amdgpu_res_next(&cursor, cursor.size);
>> }
>> --
>> 2.43.0
>>
More information about the amd-gfx
mailing list