drm/i915: Change i915_vma_unbind() to report -EAGAIN on activity
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 8 Dec 2019 16:12:52 +0000 (16:12 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 9 Dec 2019 11:49:57 +0000 (11:49 +0000)
If someone else acquires the i915_vma before we complete our wait and
unbind it, we currently error out with -EBUSY. Use -EAGAIN instead so
that if necessary the caller is prepared to try again.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/683
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191208161252.3015727-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_vma.c

index 9ca6664c190c126a742a1a096664249a50c219e9..6794c742fbbf7eff6ceef4694dd730c4d6fadd73 100644 (file)
@@ -1181,7 +1181,7 @@ int __i915_vma_unbind(struct i915_vma *vma)
        GEM_BUG_ON(i915_vma_is_active(vma));
        if (i915_vma_is_pinned(vma)) {
                vma_print_allocator(vma, "is pinned");
-               return -EBUSY;
+               return -EAGAIN;
        }
 
        GEM_BUG_ON(i915_vma_is_active(vma));