Commit 03dc00c7 authored by Michal Wajdeczko's avatar Michal Wajdeczko
Browse files

drm/xe/pf: Split VF FLR processing function



On multi-GT platforms (like PTL) we may want to run VF FLR on each
GuC (render and media) in parallel. Split our FLR function to allow
to wait for GT VF FLR completion separately.

Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Link: https://lore.kernel.org/r/20250930233525.201263-6-michal.wajdeczko@intel.com
parent 1f018c84
Loading
Loading
Loading
Loading
+21 −1
Original line number Diff line number Diff line
@@ -1172,11 +1172,31 @@ static void pf_enter_vf_flr_guc_done(struct xe_gt *gt, unsigned int vfid)
 * Return: 0 on success or a negative error code on failure.
 */
int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid)
{
	pf_enter_vf_flr_wip(gt, vfid);

	return 0;
}

/**
 * xe_gt_sriov_pf_control_wait_flr() - Wait for a VF FLR to complete.
 * @gt: the &xe_gt
 * @vfid: the VF identifier
 *
 * This function is for PF only.
 *
 * Return: 0 on success or a negative error code on failure.
 */
int xe_gt_sriov_pf_control_wait_flr(struct xe_gt *gt, unsigned int vfid)
{
	unsigned long timeout = pf_get_default_timeout(XE_GT_SRIOV_STATE_FLR_WIP);
	int err;

	pf_enter_vf_flr_wip(gt, vfid);
	if (pf_check_vf_state(gt, vfid, XE_GT_SRIOV_STATE_FLR_FAILED))
		return -EIO;

	if (!pf_check_vf_state(gt, vfid, XE_GT_SRIOV_STATE_FLR_WIP))
		return 0;

	err = pf_wait_vf_wip_done(gt, vfid, timeout);
	if (err) {
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ int xe_gt_sriov_pf_control_pause_vf(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_control_resume_vf(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_control_stop_vf(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid);
int xe_gt_sriov_pf_control_wait_flr(struct xe_gt *gt, unsigned int vfid);

#ifdef CONFIG_PCI_IOV
int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);
+5 −0
Original line number Diff line number Diff line
@@ -113,5 +113,10 @@ int xe_sriov_pf_control_reset_vf(struct xe_device *xe, unsigned int vfid)
		result = result ? -EUCLEAN : err;
	}

	for_each_gt(gt, xe, id) {
		err = xe_gt_sriov_pf_control_wait_flr(gt, vfid);
		result = result ? -EUCLEAN : err;
	}

	return result;
}