Skip to content

Commit 86c5b70

Browse files
tejasupmattrope
authored andcommitted
drm/xe/xe2: Add Wa_15015404425
Wa_15015404425 asks us to perform four "dummy" writes to a non-existent register offset before every real register read. Although the specific offset of the writes doesn't directly matter, the workaround suggests offset 0x130030 as a good target so that these writes will be easy to recognize and filter out in debugging traces. V5(MattR): - Avoid negating an equality comparison V4(MattR): - Use writel and remove xe_reg usage V3(MattR): - Define dummy reg local to function - Avoid tracing dummy writes - Update commit message V2: - Add WA to 8/16/32bit reads also - MattR - Corrected dummy reg address - MattR - Use for loop to avoid mental pause - JaniN Reviewed-by: Matt Roper <[email protected]> Signed-off-by: Tejas Upadhyay <[email protected]> Signed-off-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4c3fe5e commit 86c5b70

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,29 @@ int xe_mmio_init(struct xe_device *xe)
121121
return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
122122
}
123123

124+
static void mmio_flush_pending_writes(struct xe_gt *gt)
125+
{
126+
#define DUMMY_REG_OFFSET 0x130030
127+
struct xe_tile *tile = gt_to_tile(gt);
128+
int i;
129+
130+
if (tile->xe->info.platform != XE_LUNARLAKE)
131+
return;
132+
133+
/* 4 dummy writes */
134+
for (i = 0; i < 4; i++)
135+
writel(0, tile->mmio.regs + DUMMY_REG_OFFSET);
136+
}
137+
124138
u8 xe_mmio_read8(struct xe_gt *gt, struct xe_reg reg)
125139
{
126140
struct xe_tile *tile = gt_to_tile(gt);
127141
u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
128142
u8 val;
129143

144+
/* Wa_15015404425 */
145+
mmio_flush_pending_writes(gt);
146+
130147
val = readb((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
131148
trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
132149

@@ -139,6 +156,9 @@ u16 xe_mmio_read16(struct xe_gt *gt, struct xe_reg reg)
139156
u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
140157
u16 val;
141158

159+
/* Wa_15015404425 */
160+
mmio_flush_pending_writes(gt);
161+
142162
val = readw((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
143163
trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
144164

@@ -160,6 +180,9 @@ u32 xe_mmio_read32(struct xe_gt *gt, struct xe_reg reg)
160180
u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
161181
u32 val;
162182

183+
/* Wa_15015404425 */
184+
mmio_flush_pending_writes(gt);
185+
163186
if (!reg.vf && IS_SRIOV_VF(gt_to_xe(gt)))
164187
val = xe_gt_sriov_vf_read32(gt, reg);
165188
else

0 commit comments

Comments
 (0)