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