[PATCH] drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close

Ashutosh Dixit ashutosh.dixit at intel.com
Tue Sep 24 21:28:47 UTC 2024


From: José Roberto de Souza <jose.souza at intel.com>

Mesa testing on Xe2+ revealed that when OA metrics are collected for an
exec_queue, after the OA stream is closed, future batch buffers submitted
on that exec_queue do not complete. Not resetting OAC_CONTEXT_ENABLE on OA
stream close resolves these hangs and should not have any adverse effects.

Bspec: 60314
Fixes: 2f4a730fcd2d ("drm/xe/oa: Add OAR support")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2821
Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit at intel.com>
---
 drivers/gpu/drm/xe/xe_oa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 6d17f89a132d2..ee172d5befc82 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -774,7 +774,7 @@ static int xe_oa_configure_oar_context(struct xe_oa_stream *stream, bool enable)
 
 	/* Modify stream hwe context image with regs_context */
 	err = xe_oa_modify_ctx_image(stream, stream->exec_q->lrc[0],
-				     regs_context, ARRAY_SIZE(regs_context));
+				     regs_context, enable ? ARRAY_SIZE(regs_context) : 1);
 	if (err)
 		return err;
 
-- 
2.41.0



More information about the Intel-xe mailing list