<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - gem cancel_userptr warning"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97343#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - gem cancel_userptr warning"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=97343">bug 97343</a>
              from <span class="vcard"><a class="email" href="mailto:matthew.auld@intel.com" title="mwa <matthew.auld@intel.com>"> <span class="fn">mwa</span></a>
</span></b>
        <pre>Same thing again. Interestingly I never actually hit the WARN in vma_unbind.

hmmm, if I add:

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 94fc051..8b66098 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -286,7 +286,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
 {
        struct i915_vma *vma;
        LIST_HEAD(still_in_list);
-       int ret;
+       int ret = -42;

        /* The vma will only be freed if it is marked as closed, and if we wait
         * upon rendering to the vma, we may unbind anything in the list.
diff --git a/drivers/gpu/drm/i915/i915_gem_userptr.c
b/drivers/gpu/drm/i915/i915_gem_userptr.c
index e20b653..06b3ed1 100644
--- a/drivers/gpu/drm/i915/i915_gem_userptr.c
+++ b/drivers/gpu/drm/i915/i915_gem_userptr.c
@@ -77,6 +77,7 @@ static void cancel_userptr(struct work_struct *work)
        struct drm_i915_gem_object *obj = mo->obj;
        struct drm_device *dev = obj->base.dev;
        bool was_interruptible;
+       int ret;

        wait_rendering(obj);

@@ -89,10 +90,13 @@ static void cancel_userptr(struct work_struct *work)
        to_i915(dev)->mm.interruptible = false;

        /* We are inside a kthread context and can't be interrupted */
-       if (i915_gem_object_unbind(obj) == 0)
+       ret = i915_gem_object_unbind(obj);
+       if (ret == 0)
                __i915_gem_object_put_pages(obj);
+
        WARN_ONCE(obj->mm.pages,
-                 "Failed to release pages: bind_count=%d, pages_pin_count=%d,
pin_display=%d\n",
+                 "Failed to release pages: ret=%d, bind_count=%d,
pages_pin_count=%d, pin_display=%d\n",
+                 ret,
                  obj->bind_count,
                  atomic_read(&obj->mm.pages_pin_count),
                  obj->pin_display);

I get: Failed to release pages: ret=-42, bind_count=1, pages_pin_count=1,
pin_display=0</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>