Re: [PATCH v4 2/3] drm/i915: Fix userptr deadlock with aliased GTT mmappings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 09/10/2015 11:25 AM, Tvrtko Ursulin wrote:
+
+    active = false;
+    if (pinned < 0)
+        ret = pinned;
+    else if (pinned < num_pages)
+        ret = __i915_gem_userptr_get_pages_schedule(obj, &active);
+    else
          ret = __i915_gem_userptr_set_pages(obj, pvec, num_pages);
-        if (ret == 0) {
-            obj->userptr.work = NULL;
-            pinned = 0;
-        }
+    if (ret) {
+        __i915_gem_userptr_set_active(obj, active);
+        release_pages(pvec, pinned, 0);

I think it would be safer to set pinned to zero in the pinned < 0 case,
rather than rely on release_pages implementation knowledge. Otherwise it
is too fragile.

If you can put that back you can put my R-B on the patch.

Or possibly even better:

if (pinned >= 0)
	release_pages(...);

?

Tvrtko

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux