Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
Link: https://lore.kernel.org/r/20250930233525.201263-6-michal.wajdeczko@intel.com

+27 -1
+21 -1
drivers/gpu/drm/xe/xe_gt_sriov_pf_control.c
··· 1173 1173 */ 1174 1174 int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid) 1175 1175 { 1176 + pf_enter_vf_flr_wip(gt, vfid); 1177 + 1178 + return 0; 1179 + } 1180 + 1181 + /** 1182 + * xe_gt_sriov_pf_control_wait_flr() - Wait for a VF FLR to complete. 1183 + * @gt: the &xe_gt 1184 + * @vfid: the VF identifier 1185 + * 1186 + * This function is for PF only. 1187 + * 1188 + * Return: 0 on success or a negative error code on failure. 1189 + */ 1190 + int xe_gt_sriov_pf_control_wait_flr(struct xe_gt *gt, unsigned int vfid) 1191 + { 1176 1192 unsigned long timeout = pf_get_default_timeout(XE_GT_SRIOV_STATE_FLR_WIP); 1177 1193 int err; 1178 1194 1179 - pf_enter_vf_flr_wip(gt, vfid); 1195 + if (pf_check_vf_state(gt, vfid, XE_GT_SRIOV_STATE_FLR_FAILED)) 1196 + return -EIO; 1197 + 1198 + if (!pf_check_vf_state(gt, vfid, XE_GT_SRIOV_STATE_FLR_WIP)) 1199 + return 0; 1180 1200 1181 1201 err = pf_wait_vf_wip_done(gt, vfid, timeout); 1182 1202 if (err) {
+1
drivers/gpu/drm/xe/xe_gt_sriov_pf_control.h
··· 18 18 int xe_gt_sriov_pf_control_resume_vf(struct xe_gt *gt, unsigned int vfid); 19 19 int xe_gt_sriov_pf_control_stop_vf(struct xe_gt *gt, unsigned int vfid); 20 20 int xe_gt_sriov_pf_control_trigger_flr(struct xe_gt *gt, unsigned int vfid); 21 + int xe_gt_sriov_pf_control_wait_flr(struct xe_gt *gt, unsigned int vfid); 21 22 22 23 #ifdef CONFIG_PCI_IOV 23 24 int xe_gt_sriov_pf_control_process_guc2pf(struct xe_gt *gt, const u32 *msg, u32 len);
+5
drivers/gpu/drm/xe/xe_sriov_pf_control.c
··· 113 113 result = result ? -EUCLEAN : err; 114 114 } 115 115 116 + for_each_gt(gt, xe, id) { 117 + err = xe_gt_sriov_pf_control_wait_flr(gt, vfid); 118 + result = result ? -EUCLEAN : err; 119 + } 120 + 116 121 return result; 117 122 }