Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] drm/xe/xe2: Add Wa_15015404425
@ 2024-07-03  6:46 Tejas Upadhyay
  2024-07-03 23:23 ` Matt Roper
                   ` (8 more replies)
  0 siblings, 9 replies; 11+ messages in thread
From: Tejas Upadhyay @ 2024-07-03  6:46 UTC (permalink / raw)
  To: intel-xe; +Cc: Matt Roper, Tejas Upadhyay

Wa_15015404425 applies to xe2 LNL all steppings

V2:
  - Add WA to 8/16/32bit reads also - MattR
  - Corrected dummy reg address - MattR
  - Use for loop to avoid mental pause - JaniN

Signed-off-by: Tejas Upadhyay <tejas.upadhyay@intel.com>
---
 drivers/gpu/drm/xe/regs/xe_regs.h |  1 +
 drivers/gpu/drm/xe/xe_mmio.c      | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/drivers/gpu/drm/xe/regs/xe_regs.h b/drivers/gpu/drm/xe/regs/xe_regs.h
index 23e33ec84902..56a1ba59cbd3 100644
--- a/drivers/gpu/drm/xe/regs/xe_regs.h
+++ b/drivers/gpu/drm/xe/regs/xe_regs.h
@@ -45,6 +45,7 @@
 #define STOLEN_RESERVED				XE_REG(0x1082c0)
 #define   WOPCM_SIZE_MASK			REG_GENMASK64(9, 7)
 
+#define MEDIA_DUMMY_REG				XE_REG(0x130030)
 #define MTL_RP_STATE_CAP			XE_REG(0x138000)
 
 #define MTL_GT_RPE_FREQUENCY			XE_REG(0x13800c)
diff --git a/drivers/gpu/drm/xe/xe_mmio.c b/drivers/gpu/drm/xe/xe_mmio.c
index f92faad4b96d..51022a560086 100644
--- a/drivers/gpu/drm/xe/xe_mmio.c
+++ b/drivers/gpu/drm/xe/xe_mmio.c
@@ -121,12 +121,28 @@ int xe_mmio_init(struct xe_device *xe)
 	return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
 }
 
+static void mmio_flush_pending_writes(struct xe_gt *gt)
+{
+	struct xe_device *xe = gt_to_xe(gt);
+	int i;
+
+	if (!(xe->info.platform == XE_LUNARLAKE))
+		return;
+
+	/* 4 dummy writes */
+	for (i = 0; i < 4; i++)
+		xe_mmio_write32(gt, MEDIA_DUMMY_REG, 0);
+}
+
 u8 xe_mmio_read8(struct xe_gt *gt, struct xe_reg reg)
 {
 	struct xe_tile *tile = gt_to_tile(gt);
 	u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
 	u8 val;
 
+	/* Wa_15015404425 */
+	mmio_flush_pending_writes(gt);
+
 	val = readb((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
 	trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
 
@@ -139,6 +155,9 @@ u16 xe_mmio_read16(struct xe_gt *gt, struct xe_reg reg)
 	u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
 	u16 val;
 
+	/* Wa_15015404425 */
+	mmio_flush_pending_writes(gt);
+
 	val = readw((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
 	trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
 
@@ -160,6 +179,9 @@ u32 xe_mmio_read32(struct xe_gt *gt, struct xe_reg reg)
 	u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
 	u32 val;
 
+	/* Wa_15015404425 */
+	mmio_flush_pending_writes(gt);
+
 	if (!reg.vf && IS_SRIOV_VF(gt_to_xe(gt)))
 		val = xe_gt_sriov_vf_read32(gt, reg);
 	else
-- 
2.25.1


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

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

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03  6:46 [PATCH V2] drm/xe/xe2: Add Wa_15015404425 Tejas Upadhyay
2024-07-03 23:23 ` Matt Roper
2024-07-09 17:46   ` Lucas De Marchi
2024-07-04  5:40 ` ✓ CI.Patch_applied: success for drm/xe/xe2: Add Wa_15015404425 (rev2) Patchwork
2024-07-04  5:40 ` ✓ CI.checkpatch: " Patchwork
2024-07-04  5:41 ` ✓ CI.KUnit: " Patchwork
2024-07-04  5:53 ` ✓ CI.Build: " Patchwork
2024-07-04  5:55 ` ✓ CI.Hooks: " Patchwork
2024-07-04  5:57 ` ✓ CI.checksparse: " Patchwork
2024-07-04  6:20 ` ✓ CI.BAT: " Patchwork
2024-07-04  7:24 ` ✓ CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox