All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Oak Zeng <oak.zeng@intel.com>, intel-gfx@lists.freedesktop.org
Cc: srinivasan.s@intel.com, sudeep.dutt@intel.com, cq.tang@intel.com,
	chris@chris-wilson.co.uk, matthew.auld@intel.com
Subject: Re: [Intel-gfx] [PATCH] drm/i915/selftests: Wait request to finish
Date: Mon, 18 Oct 2021 08:49:35 +0100	[thread overview]
Message-ID: <ec2d632d-fc87-08a3-0aaf-f7490ea2d8a1@linux.intel.com> (raw)
In-Reply-To: <20211018034256.816113-1-oak.zeng@intel.com>


On 18/10/2021 04:42, Oak Zeng wrote:
> Caller of function igt_gpu_fill_dw assumes when this function
> returns, the gpu command to fill dword is already finished.
> Caller usually checks the GPU filling result immediately, see
> the usage in function __igt_write_huge. If there is no wait,
> when function igt_gpu_fill_dw returns, the GPU command is not
> guaranteed to be finished. So wait for request to finish.

There is more than one caller and the first one I looked at already does 
wait so the above is not fully accurate.

I your example of __igt_write_huge you have i915_gem_object_prepare_read 
called before the assert which does object wait, so that too is not a 
missing wait.

I haven't checked the rest. So perhaps say what failure you are trying 
to fix with a link to a CI report or something?

> 
> Signed-off-by: Oak Zeng <oak.zeng@intel.com>
> ---
>   drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c b/drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c
> index b35c1219c852..5fa595ed30b1 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/igt_gem_utils.c
> @@ -157,6 +157,7 @@ int igt_gpu_fill_dw(struct intel_context *ce,
>   	if (err)
>   		i915_request_set_error_once(rq, err);
>   	i915_request_add(rq);
> +	err = i915_request_wait(rq, 0, HZ/5);

For you reference this exploded in CI because as soon as 
i915_request_add() you are giving your rq reference to the backend and 
i915_request_wait can/will therefore ooops. If you used this pattern 
somewhere you'd need to do:

i915_request_get()
i915_request_add()
i915_request_wait()
i915_request_put()

Regards,

Tvrtko

>   err_batch:
>   	i915_vma_unpin_and_release(&batch, 0);
>   	return err;
> 

  parent reply	other threads:[~2021-10-18  7:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18  3:42 [Intel-gfx] [PATCH] drm/i915/selftests: Wait request to finish Oak Zeng
2021-10-18  2:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-10-18  3:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-10-18  7:49 ` Tvrtko Ursulin [this message]
2021-10-18  7:54 ` [Intel-gfx] [PATCH] " Matthew Auld

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=ec2d632d-fc87-08a3-0aaf-f7490ea2d8a1@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=cq.tang@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=oak.zeng@intel.com \
    --cc=srinivasan.s@intel.com \
    --cc=sudeep.dutt@intel.com \
    /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.