Skip to content

Commit cbc6e98

Browse files
tejasuprodrigovivi
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] (cherry picked from commit 86c5b70) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 7e81285 commit cbc6e98

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
@@ -124,12 +124,29 @@ int xe_mmio_init(struct xe_device *xe)
124124
return devm_add_action_or_reset(xe->drm.dev, mmio_fini, xe);
125125
}
126126

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

147+
/* Wa_15015404425 */
148+
mmio_flush_pending_writes(gt);
149+
133150
val = readb((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
134151
trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
135152

@@ -142,6 +159,9 @@ u16 xe_mmio_read16(struct xe_gt *gt, struct xe_reg reg)
142159
u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
143160
u16 val;
144161

162+
/* Wa_15015404425 */
163+
mmio_flush_pending_writes(gt);
164+
145165
val = readw((reg.ext ? tile->mmio_ext.regs : tile->mmio.regs) + addr);
146166
trace_xe_reg_rw(gt, false, addr, val, sizeof(val));
147167

@@ -163,6 +183,9 @@ u32 xe_mmio_read32(struct xe_gt *gt, struct xe_reg reg)
163183
u32 addr = xe_mmio_adjusted_addr(gt, reg.addr);
164184
u32 val;
165185

186+
/* Wa_15015404425 */
187+
mmio_flush_pending_writes(gt);
188+
166189
if (!reg.vf && IS_SRIOV_VF(gt_to_xe(gt)))
167190
val = xe_gt_sriov_vf_read32(gt, reg);
168191
else

0 commit comments

Comments
 (0)