Skip to contentSkip to conversation

drm/amdgpu: remove invalid resource->start check

PATCH In review Christian König 2 participants 3 messages Mar 20, 2024 – Mar 27, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: remove invalid resource->start check

The majority of those where removed in the patch aed01a68047b drm/amdgpu: Remove TTM resource->start visible VRAM condition v2

But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.

Fixes aed01a68047b ("drm/amdgpu: Remove TTM resource->start visible VRAM condition v2")
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -3
index b0ed10f4de60..6bd7e71c5ff6 100644
@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,
 		break;
 	case TTM_PL_VRAM:
 		mem->bus.offset = mem->start << PAGE_SHIFT;
-		/* check if it's visible */
-		if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size)
-			return -EINVAL;
 
 		if (adev->mman.aper_base_kaddr &&
 		    mem->placement & TTM_PL_FLAG_CONTIGUOUS)
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Le 20/03/2024 à 13:49, Christian König a écrit :

Quoted 10 lines

The majority of those where removed in the patch aed01a68047b drm/amdgpu: Remove TTM resource->start visible VRAM condition v2

But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.

Fixes aed01a68047b ("drm/amdgpu: Remove TTM resource->start visible VRAM condition v2")

Thanks!

Quoted 18 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -3
index b0ed10f4de60..6bd7e71c5ff6 100644
@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,
  		break;
  	case TTM_PL_VRAM:
  		mem->bus.offset = mem->start << PAGE_SHIFT;
-		/* check if it's visible */
-		if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size)
-			return -EINVAL;
 
  		if (adev->mman.aper_base_kaddr &&
  		    mem->placement & TTM_PL_FLAG_CONTIGUOUS)
#2 lore raw

On my kernel branch this produces an "unused variable" warning for 'bus_size' so it should be dropped as well.

Pierre-Eric

Le 21/03/2024 à 13:25, Pierre-Eric Pelloux-Prayer a écrit :

Quoted 35 lines

Le 20/03/2024 à 13:49, Christian König a écrit :

Quoted 10 lines

The majority of those where removed in the patch aed01a68047b drm/amdgpu: Remove TTM resource->start visible VRAM condition v2

But this one was missed because it's working on the resource and not the BO. Since we also no longer use a fake start address for visible BOs this will now trigger invalid mapping errors.

Fixes aed01a68047b ("drm/amdgpu: Remove TTM resource->start visible VRAM condition v2")

Thanks!

Quoted 17 lines

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 3 ---

  1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
index b0ed10f4de60..6bd7e71c5ff6 100644
@@ -573,9 +573,6 @@ static int amdgpu_ttm_io_mem_reserve(struct ttm_device *bdev,
           break;

      case TTM_PL_VRAM:
          mem->bus.offset = mem->start << PAGE_SHIFT;
-        /* check if it's visible */
-        if ((mem->bus.offset + bus_size) > adev->gmc.visible_vram_size) -            return -EINVAL;
          if (adev->mman.aper_base_kaddr &&
              mem->placement & TTM_PL_FLAG_CONTIGUOUS)