Skip to content

Commit 9f706fd

Browse files
mwajdeczrodrigovivi
authored andcommitted
drm/xe/pf: Fix migration initialization
The migration support only needs to be initialized once, but it was incorrectly called from the xe_gt_sriov_pf_init_hw(), which is part of the reset flow and may be called multiple times. Fixes: d86e373 ("drm/xe/pf: Add functions to save and restore VF GuC state") Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20250120232443.544-1-michal.wajdeczko@intel.com (cherry picked from commit 9ebb584) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
1 parent 588c200 commit 9f706fd

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

drivers/gpu/drm/xe/xe_gt.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,10 @@ static int all_fw_domain_init(struct xe_gt *gt)
532532
if (IS_SRIOV_PF(gt_to_xe(gt)) && !xe_gt_is_media_type(gt))
533533
xe_lmtt_init_hw(&gt_to_tile(gt)->sriov.pf.lmtt);
534534

535-
if (IS_SRIOV_PF(gt_to_xe(gt)))
535+
if (IS_SRIOV_PF(gt_to_xe(gt))) {
536+
xe_gt_sriov_pf_init(gt);
536537
xe_gt_sriov_pf_init_hw(gt);
538+
}
537539

538540
xe_force_wake_put(gt_to_fw(gt), fw_ref);
539541

drivers/gpu/drm/xe/xe_gt_sriov_pf.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
6868
return 0;
6969
}
7070

71+
/**
72+
* xe_gt_sriov_pf_init - Prepare SR-IOV PF data structures on PF.
73+
* @gt: the &xe_gt to initialize
74+
*
75+
* Late one-time initialization of the PF data.
76+
*
77+
* Return: 0 on success or a negative error code on failure.
78+
*/
79+
int xe_gt_sriov_pf_init(struct xe_gt *gt)
80+
{
81+
return xe_gt_sriov_pf_migration_init(gt);
82+
}
83+
7184
static bool pf_needs_enable_ggtt_guest_update(struct xe_device *xe)
7285
{
7386
return GRAPHICS_VERx100(xe) == 1200;
@@ -90,7 +103,6 @@ void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
90103
pf_enable_ggtt_guest_update(gt);
91104

92105
xe_gt_sriov_pf_service_update(gt);
93-
xe_gt_sriov_pf_migration_init(gt);
94106
}
95107

96108
static u32 pf_get_vf_regs_stride(struct xe_device *xe)

drivers/gpu/drm/xe/xe_gt_sriov_pf.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ struct xe_gt;
1010

1111
#ifdef CONFIG_PCI_IOV
1212
int xe_gt_sriov_pf_init_early(struct xe_gt *gt);
13+
int xe_gt_sriov_pf_init(struct xe_gt *gt);
1314
void xe_gt_sriov_pf_init_hw(struct xe_gt *gt);
1415
void xe_gt_sriov_pf_sanitize_hw(struct xe_gt *gt, unsigned int vfid);
1516
void xe_gt_sriov_pf_restart(struct xe_gt *gt);
@@ -19,6 +20,11 @@ static inline int xe_gt_sriov_pf_init_early(struct xe_gt *gt)
1920
return 0;
2021
}
2122

23+
static inline int xe_gt_sriov_pf_init(struct xe_gt *gt)
24+
{
25+
return 0;
26+
}
27+
2228
static inline void xe_gt_sriov_pf_init_hw(struct xe_gt *gt)
2329
{
2430
}

0 commit comments

Comments
 (0)