drm/ttm: fixup ttm_bo_add_move_fence
Subsystems (3)
Matthew Auld
reviewerPATCH v2 1/1 drm/ttm: fixup ttm_bo_add_move_fence
It looks like we still need to call dma_fence_put() on the man->move, otherwise we just end up leaking it, leading to fireworks later.
v2(Daniel):
- Simplify the function tail
Fixes 8bb31587820a ("drm/ttm: remove bo->moving")
Cc Christian König <[email protected]>
Cc Daniel Vetter <[email protected]>
Signed-off-by Matthew Auld <[email protected]>
Reviewed-by Christian König <[email protected]>
Reviewed-by Daniel Vetter <[email protected]>
--- drivers/gpu/drm/ttm/ttm_bo.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/ttm/ttm_bo.c +3 -5
@@ -740,11 +740,9 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,dma_resv_add_fence (bo->base.resv, fence,DMA_RESV_USAGE_KERNEL ); ret =dma_resv_reserve_fences (bo->base.resv,1 ); -if (unlikely (ret)) { -dma_fence_put (fence); -return ret; - } -return 0 ; + +dma_fence_put (fence); +return ret; }/*
Signature · 1 line
2.34.1
Am 13.04.22 um 10:51 schrieb Matthew Auld:
Quoted 6 lines
It looks like we still need to call
dma_fence_put()on theman->move, otherwise we just end up leaking it, leading to fireworks later.v2(Daniel):
- Simplify the function tail
Quoted 7 lines
Fixes 8bb31587820a ("drm/ttm: remove bo->moving")Cc Christian König <[email protected]>Cc Daniel Vetter <[email protected]>Signed-off-by Matthew Auld <[email protected]>Reviewed-by Christian König <[email protected]>Reviewed-by Daniel Vetter <[email protected]>
I've just pushed this version here to drm-misc-next.
Thanks,
Christian.
Quoted 23 lines
--- drivers/gpu/drm/ttm/ttm_bo.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/gpu/drm/ttm/ttm_bo.c +3
-5@@ -740,11 +740,9 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo,dma_resv_add_fence (bo->base.resv, fence,DMA_RESV_USAGE_KERNEL ); ret =dma_resv_reserve_fences (bo->base.resv,1 ); -if (unlikely (ret)) { -dma_fence_put (fence); -return ret; - } -return 0 ; + +dma_fence_put (fence); +return ret; }/*