Am 25.03.25 um 07:46 schrieb Prike Liang:
> Reserve the move fence space before adding the fence
> to reserve objection.

NAK, the caller is doing this. We are just reserving a new slot for the next 
move here.

Aborting without noting the fence is illegal and would lead to memory 
corruption.

Regards,
Christian.

>
> Signed-off-by: Prike Liang <prike.li...@amd.com>
> ---
>  drivers/gpu/drm/ttm/ttm_bo.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index f9a84d07dcbc..d5eab0078360 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -646,9 +646,15 @@ static int ttm_bo_add_move_fence(struct 
> ttm_buffer_object *bo,
>               return ret;
>       }
>  
> +     ret = dma_resv_reserve_fences(bo->base.resv, 1);
> +     if (ret) {
> +             pr_err("Resv shared move fence space failed\n");
> +             goto err_resv;
> +     }
> +
>       dma_resv_add_fence(bo->base.resv, fence, DMA_RESV_USAGE_KERNEL);
>  
> -     ret = dma_resv_reserve_fences(bo->base.resv, 1);
> +err_resv:
>       dma_fence_put(fence);
>       return ret;
>  }

Reply via email to