On Fri, 6 Mar 2026 15:17:25 +0000
Steven Price <[email protected]> wrote:
> > +int panthor_vm_evict_bo_mappings_locked(struct panthor_gem_object *bo)
> > +{
> > + struct drm_gpuvm_bo *vm_bo;
> > +
> > + drm_gem_for_each_gpuvm_bo(vm_bo, &bo->base) {
> > + struct panthor_vm *vm = container_of(vm_bo->vm, struct
> > panthor_vm, base);
> > + struct drm_gpuva *va;
> > +
> > + /* Skip already evicted GPU mappings. */
> > + if (vm_bo->evicted)
> > + continue;
> > +
> > + if (!mutex_trylock(&vm->op_lock))
> > + return -EDEADLK;
> > +
> > + drm_gpuvm_bo_evict(vm_bo, true);
> > + drm_gpuvm_bo_for_each_va(va, vm_bo) {
> > + struct panthor_vma *vma = container_of(va, struct
> > panthor_vma, base);
> > +
> > + if (vma->evicted)
> > + continue;
> > +
> > + panthor_vm_lock_region(vm, va->va.addr, va->va.range);
>
> NIT: You are ignoring the return value here - it might be better to bail
> out instead if this happens.
Will do in v5.
> Admittedly this is a "should never happen" case.
Better safe than sorry.