From: Chris Wilson Date: Tue, 7 Mar 2017 20:58:49 +0000 (+0000) Subject: drm/i915/userptr: Deactivate a failed userptr if the worker reports an EFAULT X-Git-Tag: v4.12-rc1~116^2~28^2~94 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=42953b3c517af6fe64e45e6491921f0c7c90511b;p=thirdparty%2Fkernel%2Flinux.git drm/i915/userptr: Deactivate a failed userptr if the worker reports an EFAULT If the worker fails, it no longer has pages to release and can be immediately removed from the invalidate-tree. Signed-off-by: Chris Wilson Cc: Michał Winiarski Cc: Tvrtko Ursulin Link: http://patchwork.freedesktop.org/patch/msgid/20170307205851.32578-1-chris@chris-wilson.co.uk Reviewed-by: Michał Winiarski Reviewed-by: Tvrtko Ursulin --- diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c index 22b46398831e0..6ef05d5b884db 100644 --- a/drivers/gpu/drm/i915/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/i915_gem_userptr.c @@ -541,6 +541,8 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work) } obj->userptr.work = ERR_CAST(pages); + if (IS_ERR(pages)) + __i915_gem_userptr_set_active(obj, false); } mutex_unlock(&obj->mm.lock);