All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: Brian Welty <brian.welty@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH] drm/xe: Fix unbind of unaccessed VMA (fault mode)
Date: Tue, 7 Nov 2023 08:03:56 +0000	[thread overview]
Message-ID: <ZUnvbDjVfKsjHfAd@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231106221538.14505-1-brian.welty@intel.com>

On Mon, Nov 06, 2023 at 02:15:38PM -0800, Brian Welty wrote:
> In fault mode, page table binding is deferred until fault handler.
> Thus vma->tile_present will be unset unless the VMA is accessed by GPU.
> 
> During a later unbind, the logic doesn't account for the fact that local
> fence variable will be NULL in this case, leading to pass NULL into
> dma_fence_add_callback() and causing few WARN_ONs to print to console.
> The fix is already present in the code, just hoist the fence variable
> computation to be done earlier.
> 
> Resolves warnings seen with igt@xe_exec_fault_mode@once-invalid-fault
> 
> Signed-off-by: Brian Welty <brian.welty@intel.com>

Reviewed-by: Matthew Brost <matthew.brost@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_vm.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
> index d26c90f0d702..d45f4f1d490f 100644
> --- a/drivers/gpu/drm/xe/xe_vm.c
> +++ b/drivers/gpu/drm/xe/xe_vm.c
> @@ -1738,14 +1738,14 @@ xe_vm_unbind_vma(struct xe_vma *vma, struct xe_exec_queue *q,
>  		}
>  	}
>  
> +	fence = cf ? &cf->base : !fence ?
> +		xe_exec_queue_last_fence_get(wait_exec_queue, vm) : fence;
>  	if (last_op) {
>  		for (i = 0; i < num_syncs; i++)
> -			xe_sync_entry_signal(&syncs[i], NULL,
> -					     cf ? &cf->base : fence);
> +			xe_sync_entry_signal(&syncs[i], NULL, fence);
>  	}
>  
> -	return cf ? &cf->base : !fence ?
> -		xe_exec_queue_last_fence_get(wait_exec_queue, vm) : fence;
> +	return fence;
>  
>  err_fences:
>  	if (fences) {
> -- 
> 2.38.0
> 

      parent reply	other threads:[~2023-11-07 15:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-06 22:15 [Intel-xe] [PATCH] drm/xe: Fix unbind of unaccessed VMA (fault mode) Brian Welty
2023-11-06 22:18 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-11-06 22:18 ` [Intel-xe] ✓ CI.checkpatch: " Patchwork
2023-11-06 22:20 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-11-06 22:28 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-11-06 22:28 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-11-06 22:29 ` [Intel-xe] ✓ CI.checksparse: " Patchwork
2023-11-06 22:58 ` [Intel-xe] ✓ CI.BAT: " Patchwork
2023-11-07  8:03 ` Matthew Brost [this message]

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=ZUnvbDjVfKsjHfAd@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=brian.welty@intel.com \
    --cc=intel-xe@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.