All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close
@ 2024-09-24 21:37 Ashutosh Dixit
  2024-09-25 18:38 ` Dixit, Ashutosh
                   ` (8 more replies)
  0 siblings, 9 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2024-09-24 21:37 UTC (permalink / raw)
  To: intel-xe

From: José Roberto de Souza <jose.souza@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.

v2: Make the change that we don't reset the bit clearer (Ashutosh)
    Also make the same fix for OAC as OAR (Ashutosh)

Bspec: 60314
Fixes: 2f4a730fcd2d ("drm/xe/oa: Add OAR support")
Fixes: 14e077f8006d ("drm/xe/oa: Add OAC support")
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2821
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/xe/xe_oa.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_oa.c b/drivers/gpu/drm/xe/xe_oa.c
index 6d17f89a132d2..30bfba6c744ca 100644
--- a/drivers/gpu/drm/xe/xe_oa.c
+++ b/drivers/gpu/drm/xe/xe_oa.c
@@ -765,8 +765,7 @@ static int xe_oa_configure_oar_context(struct xe_oa_stream *stream, bool enable)
 		{
 			RING_CONTEXT_CONTROL(stream->hwe->mmio_base),
 			regs_offset + CTX_CONTEXT_CONTROL,
-			_MASKED_FIELD(CTX_CTRL_OAC_CONTEXT_ENABLE,
-				      enable ? CTX_CTRL_OAC_CONTEXT_ENABLE : 0)
+			_MASKED_BIT_ENABLE(CTX_CTRL_OAC_CONTEXT_ENABLE),
 		},
 	};
 	struct xe_oa_reg reg_lri = { OAR_OACONTROL, oacontrol };
@@ -798,10 +797,8 @@ static int xe_oa_configure_oac_context(struct xe_oa_stream *stream, bool enable)
 		{
 			RING_CONTEXT_CONTROL(stream->hwe->mmio_base),
 			regs_offset + CTX_CONTEXT_CONTROL,
-			_MASKED_FIELD(CTX_CTRL_OAC_CONTEXT_ENABLE,
-				      enable ? CTX_CTRL_OAC_CONTEXT_ENABLE : 0) |
-			_MASKED_FIELD(CTX_CTRL_RUN_ALONE,
-				      enable ? CTX_CTRL_RUN_ALONE : 0),
+			_MASKED_BIT_ENABLE(CTX_CTRL_OAC_CONTEXT_ENABLE) |
+			_MASKED_FIELD(CTX_CTRL_RUN_ALONE, enable ? CTX_CTRL_RUN_ALONE : 0),
 		},
 	};
 	struct xe_oa_reg reg_lri = { OAC_OACONTROL, oacontrol };
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH] drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close
@ 2024-09-24 21:28 Ashutosh Dixit
  0 siblings, 0 replies; 12+ messages in thread
From: Ashutosh Dixit @ 2024-09-24 21:28 UTC (permalink / raw)
  To: intel-xe

From: José Roberto de Souza <jose.souza@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@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@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


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-09-27 17:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-24 21:37 [PATCH] drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close Ashutosh Dixit
2024-09-25 18:38 ` Dixit, Ashutosh
2024-09-26 17:03 ` ✓ CI.Patch_applied: success for drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close (rev3) Patchwork
2024-09-26 17:04 ` ✓ CI.checkpatch: " Patchwork
2024-09-26 17:05 ` ✓ CI.KUnit: " Patchwork
2024-09-26 17:16 ` ✓ CI.Build: " Patchwork
2024-09-26 17:18 ` ✓ CI.Hooks: " Patchwork
2024-09-26 17:20 ` ✓ CI.checksparse: " Patchwork
2024-09-26 17:38 ` ✓ CI.BAT: " Patchwork
2024-09-27 15:54 ` ✗ CI.FULL: failure " Patchwork
2024-09-27 17:15   ` Dixit, Ashutosh
  -- strict thread matches above, loose matches on Subject: below --
2024-09-24 21:28 [PATCH] drm/xe/oa: Don't reset OAC_CONTEXT_ENABLE on OA stream close Ashutosh Dixit

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.