All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	intel-gfx@lists.freedesktop.org,
	"# v4 . 10-rc1+" <drm-intel-fixes@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Check for timeout completion when waiting for the rq to submitted
Date: Wed, 8 Feb 2017 18:08:43 +0000	[thread overview]
Message-ID: <6eec31e2-5200-0b44-0a24-018cdcb22f5e@linux.intel.com> (raw)
In-Reply-To: <20170208175428.GX11545@nuc-i3427.alporthouse.com>


On 08/02/2017 17:54, Chris Wilson wrote:
> On Wed, Feb 08, 2017 at 05:28:39PM +0000, Tvrtko Ursulin wrote:
>>
>> On 08/02/2017 16:54, Chris Wilson wrote:
>>> We first wait for a request to be submitted to hw and assigned a seqno,
>>> before we can wait for the hw to signal completion (otherwise we don't
>>> know the hw id we need to wait upon). Whilst waiting for the request to
>>> be submitted, we may exceed the user's timeout and need to propagate the
>>> error back.
>>>
>>> Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Fixes: 4680816be336 ("drm/i915: Wait first for submission, before waiting for request completion")
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>> Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
>>> ---
>>> drivers/gpu/drm/i915/i915_gem_request.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
>>> index 72b7f7d9461d..69aff559cf8e 100644
>>> --- a/drivers/gpu/drm/i915/i915_gem_request.c
>>> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
>>> @@ -1084,6 +1084,9 @@ long i915_wait_request(struct drm_i915_gem_request *req,
>>> 		if (timeout < 0)
>>> 			goto complete;
>>>
>>> +		if (!timeout)
>>> +			return -ETIME;
>>> +
>>> 		GEM_BUG_ON(!i915_sw_fence_done(&req->execute));
>>> 	}
>>> 	GEM_BUG_ON(!i915_sw_fence_done(&req->submit));
>>>
>>
>> Perhaps "else if" would be more typical, but still OK for a fix.
>
> What I did later on in the series, was
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 72b7f7d9461d..c33f537f02b3 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -1026,7 +1026,11 @@ __i915_request_wait_for_execute(struct drm_i915_gem_request *request,
>                 }
>
>                 timeout = io_schedule_timeout(timeout);
> -       } while (timeout);
> +               if (!timeout) {
> +                       timeout = -ETIME;
> +                       break;
> +               }
> +       } while (1);
>         finish_wait(&request->execute.wait, &wait);
>
>         if (flags & I915_WAIT_LOCKED)
>
> That seemed like a more consistent pattern to use. Care to consider that as a v2?

Don't like to see "while (1)", how about:

	return timeout == 0 ? -ETIME : timeout;

For the exit of __i915_request_wait_for_execute?

Regards,

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

  reply	other threads:[~2017-02-08 18:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-08 16:54 [PATCH] drm/i915: Check for timeout completion when waiting for the rq to submitted Chris Wilson
2017-02-08 17:28 ` Tvrtko Ursulin
2017-02-08 17:54   ` Chris Wilson
2017-02-08 18:08     ` Tvrtko Ursulin [this message]
2017-02-08 18:14       ` Chris Wilson
2017-02-08 18:12 ` [PATCH v2] " Chris Wilson
2017-02-09  9:10   ` Tvrtko Ursulin
2017-02-09  9:24     ` Chris Wilson
2017-02-09  8:02 ` ✓ Fi.CI.BAT: success for drm/i915: Check for timeout completion when waiting for the rq to submitted (rev3) Patchwork
2017-02-15 12:54 ` [PATCH] drm/i915: Check for timeout completion when waiting for the rq to submitted Joonas Lahtinen
2017-02-15 13:05   ` 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=6eec31e2-5200-0b44-0a24-018cdcb22f5e@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=drm-intel-fixes@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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.