AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/ttm: test private resv obj on release/destroy
@ 2025-01-29 15:28 Christian König
  2025-01-29 15:28 ` [PATCH 2/2] drm/amdgpu: remove all KFD fences from the BO on release Christian König
  2025-01-30  2:48 ` [PATCH 1/2] drm/ttm: test private resv obj on release/destroy James Zhu
  0 siblings, 2 replies; 4+ messages in thread
From: Christian König @ 2025-01-29 15:28 UTC (permalink / raw)
  To: James.Zhu, Felix.Kuehling, Philip.Yang, amd-gfx, dri-devel

Test the fences in the private dma_resv object instead of the pointer to
a potentially shared dma_resv object.

This only matters for imported BOs with an SG table since those don't
get their dma_resv pointer replaced on release.

Signed-off-by: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 06d6a452c4f4..4d6b2143db63 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -234,7 +234,7 @@ static void ttm_bo_delayed_delete(struct work_struct *work)
 
 	bo = container_of(work, typeof(*bo), delayed_delete);
 
-	dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP, false,
+	dma_resv_wait_timeout(&bo->base._resv, DMA_RESV_USAGE_BOOKKEEP, false,
 			      MAX_SCHEDULE_TIMEOUT);
 	dma_resv_lock(bo->base.resv, NULL);
 	ttm_bo_cleanup_memtype_use(bo);
@@ -269,7 +269,7 @@ static void ttm_bo_release(struct kref *kref)
 		drm_vma_offset_remove(bdev->vma_manager, &bo->base.vma_node);
 		ttm_mem_io_free(bdev, bo->resource);
 
-		if (!dma_resv_test_signaled(bo->base.resv,
+		if (!dma_resv_test_signaled(&bo->base._resv,
 					    DMA_RESV_USAGE_BOOKKEEP) ||
 		    (want_init_on_free() && (bo->ttm != NULL)) ||
 		    bo->type == ttm_bo_type_sg ||
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-30  2:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-29 15:28 [PATCH 1/2] drm/ttm: test private resv obj on release/destroy Christian König
2025-01-29 15:28 ` [PATCH 2/2] drm/amdgpu: remove all KFD fences from the BO on release Christian König
2025-01-29 16:54   ` Felix Kuehling
2025-01-30  2:48 ` [PATCH 1/2] drm/ttm: test private resv obj on release/destroy James Zhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox