[Bug 97343] gem cancel_userptr warning

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Aug 14 16:12:01 UTC 2016


https://bugs.freedesktop.org/show_bug.cgi?id=97343

--- Comment #7 from mwa <matthew.auld at intel.com> ---
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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-gfx-bugs/attachments/20160814/66d19e07/attachment.html>


More information about the intel-gfx-bugs mailing list