Skip to content

Commit f990c11

Browse files
committed
drm/xe/vf: Catch all unexpected register reads
While we can only mimic read32 for a few GT registers for which the PF shared the values, we shouldn't avoid calling helper code if we try to access non-GT register, as then we miss to trigger a debug warning. For cases where sriov_vf_gt was not set, just use primary_gt instead. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Matt Roper <matthew.d.roper@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250311135726.1998-3-michal.wajdeczko@intel.com
1 parent d3414ac commit f990c11

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/gpu/drm/xe/xe_mmio.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,9 @@ void xe_mmio_write32(struct xe_mmio *mmio, struct xe_reg reg, u32 val)
204204

205205
trace_xe_reg_rw(mmio, true, addr, val, sizeof(val));
206206

207-
if (!reg.vf && mmio->sriov_vf_gt)
208-
xe_gt_sriov_vf_write32(mmio->sriov_vf_gt, reg, val);
207+
if (!reg.vf && IS_SRIOV_VF(mmio->tile->xe))
208+
xe_gt_sriov_vf_write32(mmio->sriov_vf_gt ?:
209+
mmio->tile->primary_gt, reg, val);
209210
else
210211
writel(val, mmio->regs + addr);
211212
}
@@ -218,8 +219,9 @@ u32 xe_mmio_read32(struct xe_mmio *mmio, struct xe_reg reg)
218219
/* Wa_15015404425 */
219220
mmio_flush_pending_writes(mmio);
220221

221-
if (!reg.vf && mmio->sriov_vf_gt)
222-
val = xe_gt_sriov_vf_read32(mmio->sriov_vf_gt, reg);
222+
if (!reg.vf && IS_SRIOV_VF(mmio->tile->xe))
223+
val = xe_gt_sriov_vf_read32(mmio->sriov_vf_gt ?:
224+
mmio->tile->primary_gt, reg);
223225
else
224226
val = readl(mmio->regs + addr);
225227

0 commit comments

Comments
 (0)