public inbox for intel-xe@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: Matt Roper <matthew.d.roper@intel.com>
Subject: [PATCH v2 08/10] drm/xe: Drop unnecessary STOP_RING clearing
Date: Fri, 24 Apr 2026 13:48:18 -0700	[thread overview]
Message-ID: <20260424-engine-setup-v2-8-59cc620a25f1@intel.com> (raw)
In-Reply-To: <20260424-engine-setup-v2-0-59cc620a25f1@intel.com>

The STOP_RING bit in MI_MODE is already clear by default out of hardware
reset and will only be '1' if the driver intentionally sets it after
that.  Furthermore, MI_MODE is part of the CSFE context, so even if the
hardware bit did somehow get set, a fresh value with the bit clear would
be re-loaded from the LRC (which is initialized zeroed).

The logic of clearing this bit appears to originate from very
early (pre-GuC, pre-execlist) code in i915 where we needed to stop the
ring before performing a host-initiated engine reset; after the reset
the STOP_RING bit needed to be cleared to allow execution to resume.

None of that is relevant to Xe (or even modern i915) since STOP_RING
isn't necessary for execlist-based engine resets (and even if it were,
Xe doesn't initiate any engine resets; the GuC handles that now).

Bspec: 60356, 60184
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/xe/regs/xe_engine_regs.h |  1 -
 drivers/gpu/drm/xe/xe_hw_engine.c        |  3 ---
 drivers/gpu/drm/xe/xe_lrc.c              | 20 --------------------
 3 files changed, 24 deletions(-)

diff --git a/drivers/gpu/drm/xe/regs/xe_engine_regs.h b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
index 4d5cd1b6f50d..c4c879a9e555 100644
--- a/drivers/gpu/drm/xe/regs/xe_engine_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_engine_regs.h
@@ -176,7 +176,6 @@
 #define RING_TIMESTAMP_UDW(base)		XE_REG((base) + 0x358 + 4)
 #define   RING_VALID_MASK			0x00000001
 #define   RING_VALID				0x00000001
-#define   STOP_RING				REG_BIT(8)
 
 #define RING_CTX_TIMESTAMP(base)		XE_REG((base) + 0x3a8)
 #define RING_CTX_TIMESTAMP_UDW(base)		XE_REG((base) + 0x3ac)
diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
index b380d3cf6d3a..91e644067cc4 100644
--- a/drivers/gpu/drm/xe/xe_hw_engine.c
+++ b/drivers/gpu/drm/xe/xe_hw_engine.c
@@ -327,9 +327,6 @@ void xe_hw_engine_enable_ring(struct xe_hw_engine *hwe)
 {
 	xe_hw_engine_mmio_write32(hwe, RING_HWS_PGA(0),
 				  xe_bo_ggtt_addr(hwe->hwsp));
-	xe_hw_engine_mmio_write32(hwe, RING_MI_MODE(0),
-				  REG_MASKED_FIELD_DISABLE(STOP_RING));
-	xe_hw_engine_mmio_read32(hwe, RING_MI_MODE(0));
 }
 
 static bool xe_hw_engine_match_fixed_cslice_mode(const struct xe_device *xe,
diff --git a/drivers/gpu/drm/xe/xe_lrc.c b/drivers/gpu/drm/xe/xe_lrc.c
index c725cde4508d..9db914584347 100644
--- a/drivers/gpu/drm/xe/xe_lrc.c
+++ b/drivers/gpu/drm/xe/xe_lrc.c
@@ -682,25 +682,6 @@ static void set_memory_based_intr(u32 *regs, struct xe_hw_engine *hwe)
 	}
 }
 
-static int lrc_ring_mi_mode(struct xe_hw_engine *hwe)
-{
-	struct xe_device *xe = gt_to_xe(hwe->gt);
-
-	if (GRAPHICS_VERx100(xe) >= 1250)
-		return 0x70;
-	else
-		return 0x60;
-}
-
-static void reset_stop_ring(u32 *regs, struct xe_hw_engine *hwe)
-{
-	int x;
-
-	x = lrc_ring_mi_mode(hwe);
-	regs[x + 1] &= ~STOP_RING;
-	regs[x + 1] |= STOP_RING << 16;
-}
-
 static inline bool xe_lrc_has_indirect_ring_state(struct xe_lrc *lrc)
 {
 	return lrc->flags & XE_LRC_FLAG_INDIRECT_RING_STATE;
@@ -980,7 +961,6 @@ static void *empty_lrc_data(struct xe_hw_engine *hwe)
 	set_offsets(regs, reg_offsets(gt_to_xe(gt), hwe->class), hwe);
 	set_context_control(regs, hwe);
 	set_memory_based_intr(regs, hwe);
-	reset_stop_ring(regs, hwe);
 	if (xe_gt_has_indirect_ring_state(gt)) {
 		regs = data + xe_gt_lrc_size(gt, hwe->class) -
 		       LRC_INDIRECT_RING_STATE_SIZE;

-- 
2.53.0


  parent reply	other threads:[~2026-04-24 20:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24 20:48 [PATCH v2 00/10] Engine initialization cleanup Matt Roper
2026-04-24 20:48 ` [PATCH v2 01/10] drm/xe: Move CCS enablement to engine setup RTP Matt Roper
2026-04-24 20:48 ` [PATCH v2 02/10] drm/xe/rtp: Add "always true" match function Matt Roper
2026-04-24 20:48 ` [PATCH v2 03/10] drm/xe: Stop programming BLIT_CCTL on Xe2 and later platforms Matt Roper
2026-04-24 20:48 ` [PATCH v2 04/10] drm/xe: Move HWSTAM programming to RTP Matt Roper
2026-04-24 20:48 ` [PATCH v2 05/10] drm/xe: Fix name and definition of GFX_MODE register Matt Roper
2026-04-24 20:48 ` [PATCH v2 06/10] drm/xe: Const-ify parameters to xe_device_has_* functions Matt Roper
2026-04-24 20:48 ` [PATCH v2 07/10] drm/xe: Move GFX_MODE programming to RTP Matt Roper
2026-04-24 20:48 ` Matt Roper [this message]
2026-04-24 20:48 ` [PATCH v2 09/10] drm/xe: Drop xe_hw_engine_mmio_write32() Matt Roper
2026-04-24 20:48 ` [PATCH v2 10/10] drm/xe: Mark BCS engines as belonging to the GT forcewake domain Matt Roper
2026-04-24 21:27 ` ✓ CI.KUnit: success for Engine initialization cleanup (rev2) Patchwork
2026-04-24 22:30 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-24 23:15 ` ✗ Xe.CI.FULL: failure " Patchwork

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=20260424-engine-setup-v2-8-59cc620a25f1@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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