Skip to content

Commit f9c15a6

Browse files
zehortigozaThomas Hellström
authored andcommitted
drm/xe: Fix crash in trace_dma_fence_init()
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: dd08ebf ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: José Roberto de Souza <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit c6878e4) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 9e3a13f commit f9c15a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/xe/xe_hw_fence.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ struct xe_hw_fence *xe_hw_fence_create(struct xe_hw_fence_ctx *ctx,
217217
if (!fence)
218218
return ERR_PTR(-ENOMEM);
219219

220-
dma_fence_init(&fence->dma, &xe_hw_fence_ops, &ctx->irq->lock,
221-
ctx->dma_fence_ctx, ctx->next_seqno++);
222-
223220
fence->ctx = ctx;
224221
fence->seqno_map = seqno_map;
225222
INIT_LIST_HEAD(&fence->irq_link);
226223

224+
dma_fence_init(&fence->dma, &xe_hw_fence_ops, &ctx->irq->lock,
225+
ctx->dma_fence_ctx, ctx->next_seqno++);
226+
227227
trace_xe_hw_fence_create(fence);
228228

229229
return fence;

0 commit comments

Comments
 (0)