Skip to content

Commit dba7d17

Browse files
committed
drm/xe/vf: Fix guc_info debugfs for VFs
The guc_info debugfs attempts to read a bunch of registers that the VFs doesn't have access to, so fix it by skipping the reads. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/4775 Signed-off-by: Daniele Ceraolo Spurio <[email protected]> Cc: Michal Wajdeczko <[email protected]> Cc: Lukasz Laguna <[email protected]> Reviewed-by: Lukasz Laguna <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent f64cf7b commit dba7d17

File tree

1 file changed

+23
-21
lines changed

1 file changed

+23
-21
lines changed

drivers/gpu/drm/xe/xe_guc.c

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,30 +1510,32 @@ void xe_guc_print_info(struct xe_guc *guc, struct drm_printer *p)
15101510

15111511
xe_uc_fw_print(&guc->fw, p);
15121512

1513-
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
1514-
if (!fw_ref)
1515-
return;
1513+
if (!IS_SRIOV_VF(gt_to_xe(gt))) {
1514+
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GT);
1515+
if (!fw_ref)
1516+
return;
1517+
1518+
status = xe_mmio_read32(&gt->mmio, GUC_STATUS);
1519+
1520+
drm_printf(p, "\nGuC status 0x%08x:\n", status);
1521+
drm_printf(p, "\tBootrom status = 0x%x\n",
1522+
REG_FIELD_GET(GS_BOOTROM_MASK, status));
1523+
drm_printf(p, "\tuKernel status = 0x%x\n",
1524+
REG_FIELD_GET(GS_UKERNEL_MASK, status));
1525+
drm_printf(p, "\tMIA Core status = 0x%x\n",
1526+
REG_FIELD_GET(GS_MIA_MASK, status));
1527+
drm_printf(p, "\tLog level = %d\n",
1528+
xe_guc_log_get_level(&guc->log));
1529+
1530+
drm_puts(p, "\nScratch registers:\n");
1531+
for (i = 0; i < SOFT_SCRATCH_COUNT; i++) {
1532+
drm_printf(p, "\t%2d: \t0x%x\n",
1533+
i, xe_mmio_read32(&gt->mmio, SOFT_SCRATCH(i)));
1534+
}
15161535

1517-
status = xe_mmio_read32(&gt->mmio, GUC_STATUS);
1518-
1519-
drm_printf(p, "\nGuC status 0x%08x:\n", status);
1520-
drm_printf(p, "\tBootrom status = 0x%x\n",
1521-
REG_FIELD_GET(GS_BOOTROM_MASK, status));
1522-
drm_printf(p, "\tuKernel status = 0x%x\n",
1523-
REG_FIELD_GET(GS_UKERNEL_MASK, status));
1524-
drm_printf(p, "\tMIA Core status = 0x%x\n",
1525-
REG_FIELD_GET(GS_MIA_MASK, status));
1526-
drm_printf(p, "\tLog level = %d\n",
1527-
xe_guc_log_get_level(&guc->log));
1528-
1529-
drm_puts(p, "\nScratch registers:\n");
1530-
for (i = 0; i < SOFT_SCRATCH_COUNT; i++) {
1531-
drm_printf(p, "\t%2d: \t0x%x\n",
1532-
i, xe_mmio_read32(&gt->mmio, SOFT_SCRATCH(i)));
1536+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
15331537
}
15341538

1535-
xe_force_wake_put(gt_to_fw(gt), fw_ref);
1536-
15371539
drm_puts(p, "\n");
15381540
xe_guc_ct_print(&guc->ct, p, false);
15391541

0 commit comments

Comments
 (0)