Skip to content

Commit 9bb2f1d

Browse files
mwajdeczrodrigovivi
authored andcommitted
drm/xe/vf: Fix signature of print functions
We have plugged-in existing VF print functions into our GT debugfs show helper as-is, but we missed that the helper expects functions to return int, while they were defined as void. This can lead to errors being reported when CFI is enabled. Fixes: 63d8cb8 ("drm/xe/vf: Expose SR-IOV VF attributes to GT debugfs") Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Mohanram Meenakshisundaram <mohanram.meenakshisundaram@intel.com> Reviewed-by: Shuicheng Lin <shuicheng.lin@intel.com> Link: https://patch.msgid.link/20260514155726.7165-1-michal.wajdeczko@intel.com (cherry picked from commit 314e31c) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent d3ded53 commit 9bb2f1d

2 files changed

Lines changed: 21 additions & 9 deletions

File tree

drivers/gpu/drm/xe/xe_gt_sriov_vf.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,13 +1137,15 @@ void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val)
11371137
}
11381138

11391139
/**
1140-
* xe_gt_sriov_vf_print_config - Print VF self config.
1140+
* xe_gt_sriov_vf_print_config() - Print VF self config.
11411141
* @gt: the &xe_gt
11421142
* @p: the &drm_printer
11431143
*
11441144
* This function is for VF use only.
1145+
*
1146+
* Return: always 0.
11451147
*/
1146-
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
1148+
int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
11471149
{
11481150
struct xe_gt_sriov_vf_selfconfig *config = &gt->sriov.vf.self_config;
11491151
struct xe_device *xe = gt_to_xe(gt);
@@ -1170,16 +1172,20 @@ void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p)
11701172

11711173
drm_printf(p, "GuC contexts:\t%u\n", config->num_ctxs);
11721174
drm_printf(p, "GuC doorbells:\t%u\n", config->num_dbs);
1175+
1176+
return 0;
11731177
}
11741178

11751179
/**
1176-
* xe_gt_sriov_vf_print_runtime - Print VF's runtime regs received from PF.
1180+
* xe_gt_sriov_vf_print_runtime() - Print VF's runtime regs received from PF.
11771181
* @gt: the &xe_gt
11781182
* @p: the &drm_printer
11791183
*
11801184
* This function is for VF use only.
1185+
*
1186+
* Return: always 0.
11811187
*/
1182-
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
1188+
int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
11831189
{
11841190
struct vf_runtime_reg *vf_regs = gt->sriov.vf.runtime.regs;
11851191
unsigned int size = gt->sriov.vf.runtime.num_regs;
@@ -1188,16 +1194,20 @@ void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p)
11881194

11891195
for (; size--; vf_regs++)
11901196
drm_printf(p, "%#x = %#x\n", vf_regs->offset, vf_regs->value);
1197+
1198+
return 0;
11911199
}
11921200

11931201
/**
1194-
* xe_gt_sriov_vf_print_version - Print VF ABI versions.
1202+
* xe_gt_sriov_vf_print_version() - Print VF ABI versions.
11951203
* @gt: the &xe_gt
11961204
* @p: the &drm_printer
11971205
*
11981206
* This function is for VF use only.
1207+
*
1208+
* Return: always 0.
11991209
*/
1200-
void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
1210+
int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
12011211
{
12021212
struct xe_device *xe = gt_to_xe(gt);
12031213
struct xe_uc_fw_version *guc_version = &gt->sriov.vf.guc_version;
@@ -1227,6 +1237,8 @@ void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p)
12271237
GUC_RELAY_VERSION_LATEST_MAJOR, GUC_RELAY_VERSION_LATEST_MINOR);
12281238
drm_printf(p, "\thandshake:\t%u.%u\n",
12291239
pf_version->major, pf_version->minor);
1240+
1241+
return 0;
12301242
}
12311243

12321244
static bool vf_post_migration_shutdown(struct xe_gt *gt)

drivers/gpu/drm/xe/xe_gt_sriov_vf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ bool xe_gt_sriov_vf_sched_groups_enabled(struct xe_gt *gt);
3535
u32 xe_gt_sriov_vf_read32(struct xe_gt *gt, struct xe_reg reg);
3636
void xe_gt_sriov_vf_write32(struct xe_gt *gt, struct xe_reg reg, u32 val);
3737

38-
void xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39-
void xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40-
void xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
38+
int xe_gt_sriov_vf_print_config(struct xe_gt *gt, struct drm_printer *p);
39+
int xe_gt_sriov_vf_print_runtime(struct xe_gt *gt, struct drm_printer *p);
40+
int xe_gt_sriov_vf_print_version(struct xe_gt *gt, struct drm_printer *p);
4141

4242
int xe_gt_sriov_vf_wait_valid_ggtt(struct xe_gt *gt);
4343
int xe_vf_migration_fixups_complete_count(struct xe_gt *gt);

0 commit comments

Comments
 (0)