[2/2] drm/i915: Change i915_vma_unbind() to report -EAGAIN on activity
diff mbox series

Message ID 20191208161252.3015727-2-chris@chris-wilson.co.uk
State New
Headers show
Series
  • [1/2] drm/i915/gem: Avoid rcu_barrier() from shrinker paths
Related show

Commit Message

Chris Wilson Dec. 8, 2019, 4:12 p.m. UTC
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.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Auld Dec. 9, 2019, 10:58 a.m. UTC | #1
On Sun, 8 Dec 2019 at 16:13, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>
> 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.
>
> 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>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 9ca6664c190c..6794c742fbbf 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -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));