Skip to content

Commit ba757a6

Browse files
ksatya-devmwajdecz
authored andcommitted
drm/xe/vf: Retry sending MMIO request to GUC on timeout error
Add support to allow retrying the sending of MMIO requests from the VF to the GUC in the event of an error. During the suspend/resume process, VFs begin resuming only after the PF has resumed. Although the PF resumes, the GUC reset and provisioning occur later in a separate worker process. When there are a large number of VFs, some may attempt to resume before the PF has completed its provisioning. Therefore, if a MMIO request from a VF fails during this period, we will retry sending the request up to GUC_RESET_VF_STATE_RETRY_MAX times, which is set to a maximum of 10 attempts. Signed-off-by: Satyanarayana K V P <[email protected]> Cc: Michał Wajdeczko <[email protected]> Cc: Michał Winiarski <[email protected]> Cc: Piotr Piórkowski <[email protected]> Reviewed-by: Piotr Piorkowski <[email protected]> Signed-off-by: Michal Wajdeczko <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 8c0aff7 commit ba757a6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/gpu/drm/xe/xe_gt_sriov_vf.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,19 @@ static int guc_action_vf_reset(struct xe_guc *guc)
4747
return ret > 0 ? -EPROTO : ret;
4848
}
4949

50+
#define GUC_RESET_VF_STATE_RETRY_MAX 10
5051
static int vf_reset_guc_state(struct xe_gt *gt)
5152
{
53+
unsigned int retry = GUC_RESET_VF_STATE_RETRY_MAX;
5254
struct xe_guc *guc = &gt->uc.guc;
5355
int err;
5456

55-
err = guc_action_vf_reset(guc);
57+
do {
58+
err = guc_action_vf_reset(guc);
59+
if (!err || err != -ETIMEDOUT)
60+
break;
61+
} while (--retry);
62+
5663
if (unlikely(err))
5764
xe_gt_sriov_err(gt, "Failed to reset GuC state (%pe)\n", ERR_PTR(err));
5865
return err;

0 commit comments

Comments
 (0)