[ Sasha's backport helper bot ] Hi, The claimed upstream commit SHA1 (55039832f98c7e05f1cf9e0d8c12b2490abd0f16) was not found. However, I found a matching commit: f0ed39830e6064d62f9c5393505677a26569bb56 Status in newer kernel trees: 6.12.y | Not found Note: The patch differs from the upstream commit: --- 1: f0ed39830e60 ! 1: 14a6fe72119e xe/oa: Fix query mode of operation for OAR/OAC @@ Metadata ## Commit message ## xe/oa: Fix query mode of operation for OAR/OAC + commit 55039832f98c7e05f1cf9e0d8c12b2490abd0f16 upstream + This is a set of squashed commits to facilitate smooth applying to stable. Each commit message is retained for reference. @@ Commit message - Drop reg_lri related comments - Use XE_OA_SUBMIT_NO_DEPS in xe_oa_load_with_lri + v6: + Backport to linux-6.12.y (Umesh) + Fixes: 8135f1c09dd2 ("drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close") Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@xxxxxxxxx> Reviewed-by: Matthew Brost <matthew.brost@xxxxxxxxx> # commit 1 Reviewed-by: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx> - Cc: stable@xxxxxxxxxxxxxxx + Cc: stable@xxxxxxxxxxxxxxx # 6.12+ Reviewed-by: Jonathan Cavitt <jonathan.cavitt@xxxxxxxxx> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx> Link: https://patchwork.freedesktop.org/patch/msgid/20241220171919.571528-2-umesh.nerlige.ramappa@xxxxxxxxx (cherry picked from commit 55039832f98c7e05f1cf9e0d8c12b2490abd0f16) Signed-off-by: Thomas Hellström <thomas.hellstrom@xxxxxxxxxxxxxxx> + (cherry picked from commit f0ed39830e6064d62f9c5393505677a26569bb56) ## drivers/gpu/drm/xe/xe_oa.c ## @@ drivers/gpu/drm/xe/xe_oa.c: struct xe_oa_config { @@ drivers/gpu/drm/xe/xe_oa.c: struct xe_oa_config { -}; - struct xe_oa_open_param { - struct xe_file *xef; u32 oa_unit_id; + bool sample; @@ drivers/gpu/drm/xe/xe_oa.c: static __poll_t xe_oa_poll(struct file *file, poll_table *wait) return ret; } @@ drivers/gpu/drm/xe/xe_oa.c: static __poll_t xe_oa_poll(struct file *file, poll_t + } +} + - static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, enum xe_oa_submit_deps deps, - struct xe_bb *bb) + static int xe_oa_submit_bb(struct xe_oa_stream *stream, struct xe_bb *bb) { + struct xe_exec_queue *q = stream->exec_q ?: stream->k_exec_q; struct xe_sched_job *job; struct dma_fence *fence; + long timeout; int err = 0; - /* Kernel configuration is issued on stream->k_exec_q, not stream->exec_q */ @@ drivers/gpu/drm/xe/xe_oa.c: static __poll_t xe_oa_poll(struct file *file, poll_t + job = xe_bb_create_job(q, bb); if (IS_ERR(job)) { err = PTR_ERR(job); ++ xe_oa_unlock_vma(q); goto exit; } + job->ggtt = true; - if (deps == XE_OA_SUBMIT_ADD_DEPS) { - for (int i = 0; i < stream->num_syncs && !err; i++) -@@ drivers/gpu/drm/xe/xe_oa.c: static struct dma_fence *xe_oa_submit_bb(struct xe_oa_stream *stream, enum xe_oa + xe_sched_job_arm(job); fence = dma_fence_get(&job->drm.s_fence->finished); xe_sched_job_push(job); + xe_oa_unlock_vma(q); + - return fence; - err_put_job: - xe_sched_job_put(job); - exit: -+ xe_oa_unlock_vma(q); - return ERR_PTR(err); - } - + timeout = dma_fence_wait_timeout(fence, false, HZ); + dma_fence_put(fence); + if (timeout < 0) @@ drivers/gpu/drm/xe/xe_oa.c: static void xe_oa_free_configs(struct xe_oa_stream *stream) - dma_fence_put(stream->last_fence); + free_oa_config_bo(oa_bo); } -static void xe_oa_store_flex(struct xe_oa_stream *stream, struct xe_lrc *lrc, @@ drivers/gpu/drm/xe/xe_oa.c: static void xe_oa_free_configs(struct xe_oa_stream * -static int xe_oa_modify_ctx_image(struct xe_oa_stream *stream, struct xe_lrc *lrc, - const struct flex *flex, u32 count) -{ -- struct dma_fence *fence; - struct xe_bb *bb; - int err; - @@ drivers/gpu/drm/xe/xe_oa.c: static void xe_oa_free_configs(struct xe_oa_stream * - - xe_oa_store_flex(stream, lrc, bb, flex, count); - -- fence = xe_oa_submit_bb(stream, XE_OA_SUBMIT_NO_DEPS, bb); -- if (IS_ERR(fence)) { -- err = PTR_ERR(fence); -- goto free_bb; -- } -- xe_bb_free(bb, fence); -- dma_fence_put(fence); -- -- return 0; --free_bb: +- err = xe_oa_submit_bb(stream, bb); - xe_bb_free(bb, NULL); -exit: - return err; @@ drivers/gpu/drm/xe/xe_oa.c: static void xe_oa_free_configs(struct xe_oa_stream * -static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *reg_lri) +static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *reg_lri, u32 count) { - struct dma_fence *fence; struct xe_bb *bb; int err; @@ drivers/gpu/drm/xe/xe_oa.c: static void xe_oa_free_configs(struct xe_oa_stream * - write_cs_mi_lri(bb, reg_lri, 1); + write_cs_mi_lri(bb, reg_lri, count); - fence = xe_oa_submit_bb(stream, XE_OA_SUBMIT_NO_DEPS, bb); - if (IS_ERR(fence)) { + err = xe_oa_submit_bb(stream, bb); + xe_bb_free(bb, NULL); @@ drivers/gpu/drm/xe/xe_oa.c: static int xe_oa_load_with_lri(struct xe_oa_stream *stream, struct xe_oa_reg *re static int xe_oa_configure_oar_context(struct xe_oa_stream *stream, bool enable) { @@ drivers/gpu/drm/xe/xe_oa.c: static int xe_oa_load_with_lri(struct xe_oa_stream * - int err; /* Set ccs select to enable programming of OAC_OACONTROL */ - xe_mmio_write32(&stream->gt->mmio, __oa_regs(stream)->oa_ctrl, - __oa_ccs_select(stream)); + xe_mmio_write32(stream->gt, __oa_regs(stream)->oa_ctrl, __oa_ccs_select(stream)); - /* Modify stream hwe context image with regs_context */ - err = xe_oa_modify_ctx_image(stream, stream->exec_q->lrc[0], --- Results of testing on various branches: | Branch | Patch Apply | Build Test | |---------------------------|-------------|------------| | stable/linux-6.12.y | Success | Success |