Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: "José Roberto de Souza" <jose.souza@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: Fix crash in trace_dma_fence_init()
Date: Wed, 24 Jan 2024 21:17:21 +0000	[thread overview]
Message-ID: <ZbF+YaiN0dRD3G2o@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20240124171830.95774-1-jose.souza@intel.com>

On Wed, Jan 24, 2024 at 09:18:30AM -0800, José Roberto de Souza wrote:
> trace_dma_fence_init() uses dma_fence_ops functions
> like get_driver_name() and get_timeline_name() to generate trace
> information but the Xe KMD implementation of those functions makes
> use of xe_hw_fence_ctx that was being set after dma_fence_init().
> 
> So here just inverting the order to fix the crash.
> 
> Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>

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

> ---
>  drivers/gpu/drm/xe/xe_hw_fence.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_hw_fence.c b/drivers/gpu/drm/xe/xe_hw_fence.c
> index a6094c81f2ad0..a5de3e7b0bd6a 100644
> --- a/drivers/gpu/drm/xe/xe_hw_fence.c
> +++ b/drivers/gpu/drm/xe/xe_hw_fence.c
> @@ -217,13 +217,13 @@ struct xe_hw_fence *xe_hw_fence_create(struct xe_hw_fence_ctx *ctx,
>  	if (!fence)
>  		return ERR_PTR(-ENOMEM);
>  
> -	dma_fence_init(&fence->dma, &xe_hw_fence_ops, &ctx->irq->lock,
> -		       ctx->dma_fence_ctx, ctx->next_seqno++);
> -
>  	fence->ctx = ctx;
>  	fence->seqno_map = seqno_map;
>  	INIT_LIST_HEAD(&fence->irq_link);
>  
> +	dma_fence_init(&fence->dma, &xe_hw_fence_ops, &ctx->irq->lock,
> +		       ctx->dma_fence_ctx, ctx->next_seqno++);
> +
>  	trace_xe_hw_fence_create(fence);
>  
>  	return fence;
> -- 
> 2.43.0
> 

      parent reply	other threads:[~2024-01-24 21:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 17:18 [PATCH] drm/xe: Fix crash in trace_dma_fence_init() José Roberto de Souza
2024-01-24 18:05 ` ✓ CI.Patch_applied: success for " Patchwork
2024-01-24 18:06 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-24 18:07 ` ✓ CI.KUnit: success " Patchwork
2024-01-24 18:14 ` ✓ CI.Build: " Patchwork
2024-01-24 18:14 ` ✓ CI.Hooks: " Patchwork
2024-01-24 18:16 ` ✓ CI.checksparse: " Patchwork
2024-01-24 18:39 ` ✓ CI.BAT: " Patchwork
2024-01-24 21:17 ` 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=ZbF+YaiN0dRD3G2o@DUT025-TGLU.fm.intel.com \
    --to=matthew.brost@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jose.souza@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox