Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/amdgpu: build failure in amdgpu_gem_object_close() after
  removing amdgpu_bo_fence()
--

commit 0712370b9809b23c4190422dc542ee1195e75ba2
Author: Benjamin Cheng <[email protected]>

drm/amdgpu/object: get rid of amdgpu_bo_fence

This commit removes the amdgpu_bo_fence() helper and its declaration.

> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c 
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> index 6aa895f63aeaf..7fc43363ec626 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
> @@ -1441,31 +1441,6 @@ vm_fault_t amdgpu_bo_fault_reserve_notify(struct 
> ttm_buffer_object *bo)
>       return 0;
>  }
>  
> -/**
> - * amdgpu_bo_fence - add fence to buffer object
> - *
> - * @bo: buffer object in question
> - * @fence: fence to add
> - * @shared: true if fence should be added shared
> - *
> - */
> -void amdgpu_bo_fence(struct amdgpu_bo *bo, struct dma_fence *fence,
> -                  bool shared)
> -{
> -     struct dma_resv *resv = bo->tbo.base.resv;
> -     int r;
> -
> -     r = dma_resv_reserve_fences(resv, 1);
> -     if (r) {
> -             /* As last resort on OOM we block for the fence */
> -             dma_fence_wait(fence, false);
> -             return;
> -     }
> -
> -     dma_resv_add_fence(resv, fence, shared ? DMA_RESV_USAGE_READ :
> -                        DMA_RESV_USAGE_WRITE);
> -}
> -
>  /**
>   * amdgpu_bo_sync_wait_resv - Wait for BO reservation fences
>   *

[Severity: High]
Does removing amdgpu_bo_fence() break the build in
amdgpu_gem_object_close()?

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c:amdgpu_gem_object_close() {
    ...
        r = amdgpu_vm_clear_freed(adev, vm, &fence);
        if (unlikely(r < 0) && !drm_dev_is_unplugged(adev_to_drm(adev)))
                dev_err(adev->dev, "failed to clear page "
                        "tables on GEM object close (%ld)\n", r);
        if (r || !fence)
                goto out_unlock;

        amdgpu_bo_fence(bo, fence, true);
        dma_fence_put(fence);
    ...
}

amdgpu_gem_object_close() still calls amdgpu_bo_fence(), so compiling
amdgpu_gem.c fails with an implicit declaration error.

-- 
Sashiko AI review · 
https://sashiko.dev/#/patchset/[email protected]?part=7

Reply via email to