Skip to content

Commit 3b358c2

Browse files
committed
drm/xe/pf: Add wait helper for VF FLR
VF FLR requires additional processing done by PF driver. The processing is done after FLR is already finished from PCIe perspective. In order to avoid a scenario where migration state transitions while PF processing is still in progress, additional synchronization point is needed. Add a helper that will be used as part of VF driver struct pci_error_handlers .reset_done() callback. Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://patch.msgid.link/20251112132220.516975-24-michal.winiarski@intel.com Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
1 parent 49cf1b9 commit 3b358c2

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_sriov_pf_control.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,30 @@ int xe_sriov_pf_control_reset_vf(struct xe_device *xe, unsigned int vfid)
123123
return result;
124124
}
125125

126+
/**
127+
* xe_sriov_pf_control_wait_flr() - Wait for a VF reset (FLR) to complete.
128+
* @xe: the &xe_device
129+
* @vfid: the VF identifier
130+
*
131+
* This function is for PF only.
132+
*
133+
* Return: 0 on success or a negative error code on failure.
134+
*/
135+
int xe_sriov_pf_control_wait_flr(struct xe_device *xe, unsigned int vfid)
136+
{
137+
struct xe_gt *gt;
138+
unsigned int id;
139+
int result = 0;
140+
int err;
141+
142+
for_each_gt(gt, xe, id) {
143+
err = xe_gt_sriov_pf_control_wait_flr(gt, vfid);
144+
result = result ? -EUCLEAN : err;
145+
}
146+
147+
return result;
148+
}
149+
126150
/**
127151
* xe_sriov_pf_control_sync_flr() - Synchronize a VF FLR between all GTs.
128152
* @xe: the &xe_device

drivers/gpu/drm/xe/xe_sriov_pf_control.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ int xe_sriov_pf_control_pause_vf(struct xe_device *xe, unsigned int vfid);
1212
int xe_sriov_pf_control_resume_vf(struct xe_device *xe, unsigned int vfid);
1313
int xe_sriov_pf_control_stop_vf(struct xe_device *xe, unsigned int vfid);
1414
int xe_sriov_pf_control_reset_vf(struct xe_device *xe, unsigned int vfid);
15+
int xe_sriov_pf_control_wait_flr(struct xe_device *xe, unsigned int vfid);
1516
int xe_sriov_pf_control_sync_flr(struct xe_device *xe, unsigned int vfid);
1617
int xe_sriov_pf_control_trigger_save_vf(struct xe_device *xe, unsigned int vfid);
1718
int xe_sriov_pf_control_finish_save_vf(struct xe_device *xe, unsigned int vfid);

0 commit comments

Comments
 (0)