On 5/8/26 08:17, Yifan Zhang wrote:
...
>  static int
>  amdgpu_gem_add_input_fence(struct drm_file *filp,
> @@ -118,13 +119,21 @@ amdgpu_gem_update_timeline_node(struct drm_file *filp,
>  static vm_fault_t amdgpu_gem_fault(struct vm_fault *vmf)
>  {
>       struct ttm_buffer_object *bo = vmf->vma->vm_private_data;
> +     struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev);
>       struct drm_device *ddev = bo->base.dev;
>       vm_fault_t ret;
>       int idx;
>  
> +     /* Prevent new mappings from coming in during reset */
> +
> +     if (!down_read_trylock(&adev->reset_domain->sem))
> +             return VM_FAULT_SIGSEGV;

Please move adding those locks into a separate patch, just add a comment here 
that we need to handle new incomming mappings.

We basically need to rework TTM and KFD to get this working correctly and that 
is a huge bunch of extra work.

> +
>       ret = ttm_bo_vm_reserve(bo, vmf);

That is obviously the wrong order. Adding the adev->reset_domain->sem lock 
would immediately cause a lockdep splat here.

So you either didn't tested this patch with lockdep enabled or our lockdep 
annotation doesn't work correctly.

Please always enable lockdep when testing patches which adds locks.

Regards,
Christian.

Reply via email to