From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH v4 2/3] drm/i915: Fix userptr deadlock with aliased GTT mmappings
Date: Thu, 10 Sep 2015 11:31:36 +0100 [thread overview]
Message-ID: <55F15C08.9040708@linux.intel.com> (raw)
In-Reply-To: <55F15A96.1080008@linux.intel.com>
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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org
Subject: Re: [Intel-gfx] [PATCH v4 2/3] drm/i915: Fix userptr deadlock with aliased GTT mmappings
Date: Thu, 10 Sep 2015 11:31:36 +0100 [thread overview]
Message-ID: <55F15C08.9040708@linux.intel.com> (raw)
In-Reply-To: <55F15A96.1080008@linux.intel.com>
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
next prev parent reply other threads:[~2015-09-10 10:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 9:51 [PATCH v4 1/3] drm/i915: Only update the current userptr worker Chris Wilson
2015-09-10 9:51 ` [PATCH v4 2/3] drm/i915: Fix userptr deadlock with aliased GTT mmappings Chris Wilson
2015-09-10 10:25 ` [Intel-gfx] " Tvrtko Ursulin
2015-09-10 10:31 ` Tvrtko Ursulin [this message]
2015-09-10 10:31 ` Tvrtko Ursulin
2015-09-10 9:51 ` [PATCH v4 3/3] drm/i915: Use a task to cancel the userptr on invalidate_range Chris Wilson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F15C08.9040708@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.