Re: [Intel-gfx] [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

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]