From fe7bce854ef5b898d74920a54559d34b80361925 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sun, 14 Aug 2016 14:58:22 +0100 Subject: [PATCH] userptr-uninterruptible --- drivers/gpu/drm/i915/i915_gem_userptr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c b/drivers/gpu/drm/i915/i915_gem_userptr.c index 23c145a6b157..e20b653c547e 100644 --- a/drivers/gpu/drm/i915/i915_gem_userptr.c +++ b/drivers/gpu/drm/i915/i915_gem_userptr.c @@ -76,6 +76,7 @@ static void cancel_userptr(struct work_struct *work) struct i915_mmu_object *mo = container_of(work, typeof(*mo), work); struct drm_i915_gem_object *obj = mo->obj; struct drm_device *dev = obj->base.dev; + bool was_interruptible; wait_rendering(obj); @@ -84,6 +85,9 @@ static void cancel_userptr(struct work_struct *work) /* Cancel any active worker and force us to re-evaluate gup */ obj->userptr.work = NULL; + was_interruptible = to_i915(dev)->mm.interruptible; + to_i915(dev)->mm.interruptible = false; + /* We are inside a kthread context and can't be interrupted */ if (i915_gem_object_unbind(obj) == 0) __i915_gem_object_put_pages(obj); @@ -93,6 +97,8 @@ static void cancel_userptr(struct work_struct *work) atomic_read(&obj->mm.pages_pin_count), obj->pin_display); + to_i915(dev)->mm.interruptible = was_interruptible; + i915_gem_object_put(obj); mutex_unlock(&dev->struct_mutex); } -- 2.8.1