Skip to contentSkip to conversation

drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag

PATCH In review Philip Yang 2 participants 2 messages Mar 11, 2024 – Mar 12, 2024

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

PATCH 1/1 drm/amdgpu: amdgpu_ttm_gart_bind set gtt bound flag

Otherwise amdgpu_ttm_backend_unbind will not clear the gart page table and leave valid mapping entry to the stale system page.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
index 75c9fd2c6c2a..b0ed10f4de60 100644
@@ -869,6 +869,7 @@ static void amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
 		amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
 				 gtt->ttm.dma_address, flags);
 	}
+	gtt->bound = true;
 }
 
 /*
Signature · 1 line
2.35.1
maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 11.03.24 um 23:21 schrieb Philip Yang:

Quoted 4 lines

Otherwise amdgpu_ttm_backend_unbind will not clear the gart page table and leave valid mapping entry to the stale system page.

Good catch, that bug is probably in there for quite a while.

Quoted 16 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
index 75c9fd2c6c2a..b0ed10f4de60 100644
@@ -869,6 +869,7 @@ static void amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
  		amdgpu_gart_bind(adev, gtt->offset, ttm->num_pages,
  				 gtt->ttm.dma_address, flags);
  	}
+	gtt->bound = true;
  }
 
  /*