]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/i915: Use EAGAIN for trylock failures
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 13 Dec 2019 16:03:47 +0000 (16:03 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 13 Dec 2019 20:16:23 +0000 (20:16 +0000)
While not good behaviour, it is, however, established behaviour that we
can punt EAGAIN to userspace if we need to retry the ioctl. When trying
to acquire a mutex, prefer to use EAGAIN to propagate losing the race
so that if it does end up back in userspace, we try again.

Fixes: c81471f5e95c ("drm/i915: Copy across scheduler behaviour flags across submit fences")
Closes: https://gitlab.freedesktop.org/drm/intel/issues/800
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191213160347.1789004-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gt/intel_timeline.c
drivers/gpu/drm/i915/i915_request.c

index 038e05a6336c829ec796065938a1bb791a42c27e..d71aafb66d6ef451faaf45542f907e2a5b3db0e9 100644 (file)
@@ -527,7 +527,7 @@ int intel_timeline_read_hwsp(struct i915_request *from,
 
        GEM_BUG_ON(rcu_access_pointer(to->timeline) == tl);
 
-       err = -EBUSY;
+       err = -EAGAIN;
        if (mutex_trylock(&tl->mutex)) {
                struct intel_timeline_cacheline *cl = from->hwsp_cacheline;
 
index c6d59d263550612aa04629639912a3e35a767c03..af2f78e040d72271f150da73639ea934911f3db0 100644 (file)
@@ -771,7 +771,7 @@ i915_request_await_start(struct i915_request *rq, struct i915_request *signal)
        if (!tl) /* already started or maybe even completed */
                return 0;
 
-       fence = ERR_PTR(-EBUSY);
+       fence = ERR_PTR(-EAGAIN);
        if (mutex_trylock(&tl->mutex)) {
                fence = NULL;
                if (!i915_request_started(signal) &&