Re: [PATCH] drm/amdgpu: Fix comparison in amdgpu_res_cpu_visible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 08.05.24 um 15:45 schrieb Alex Deucher:
On Wed, May 8, 2024 at 9:25 AM Michel Dänzer <michel@xxxxxxxxxxx> wrote:
From: Michel Dänzer <mdaenzer@xxxxxxxxxx>

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@xxxxxxxxxxx>
Signed-off-by: Michel Dänzer <mdaenzer@xxxxxxxxxx>
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>

Reviewed-by: Christian König <christian.koenig@xxxxxxx>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3343
CC: stable@xxxxxxxxxxxxxxx

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





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux