Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/xe/vf: Retry GuC state reset until timeout
@ 2026-08-31  9:21 Lukasz Laguna
  2026-08-31  9:45 ` K V P, Satyanarayana
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Lukasz Laguna @ 2026-08-31  9:21 UTC (permalink / raw)
  To: intel-xe; +Cc: michal.wajdeczko, satyanarayana.k.v.p, lukasz.laguna

Instead of using a fixed number of GuC state reset retries, keep
retrying until timeout with sleeps between attempts.

Signed-off-by: Lukasz Laguna <lukasz.laguna@intel.com>
---
 drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
index 37899fcf5b22..01873896f77b 100644
--- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
+++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c
@@ -31,6 +31,7 @@
 #include "xe_lrc.h"
 #include "xe_memirq.h"
 #include "xe_mmio.h"
+#include "xe_sleep.h"
 #include "xe_sriov.h"
 #include "xe_sriov_vf.h"
 #include "xe_sriov_vf_ccs.h"
@@ -86,18 +87,23 @@ static int guc_action_vf_reset(struct xe_guc *guc)
 	return ret > 0 ? -EPROTO : ret;
 }
 
-#define GUC_RESET_VF_STATE_RETRY_MAX	10
+#define GUC_RESET_VF_STATE_TIMEOUT_MS	10000
+#define GUC_RESET_VF_STATE_SLEEP_MS	10
+
 static int vf_reset_guc_state(struct xe_gt *gt)
 {
-	unsigned int retry = GUC_RESET_VF_STATE_RETRY_MAX;
 	struct xe_guc *guc = &gt->uc.guc;
+	unsigned long jiffies_end;
 	int err;
 
+	jiffies_end = jiffies + msecs_to_jiffies(GUC_RESET_VF_STATE_TIMEOUT_MS);
 	do {
 		err = guc_action_vf_reset(guc);
 		if (!err || err != -ETIMEDOUT)
 			break;
-	} while (--retry);
+
+		xe_sleep_relaxed_ms(GUC_RESET_VF_STATE_SLEEP_MS);
+	} while (time_before(jiffies, jiffies_end));
 
 	if (unlikely(err))
 		xe_gt_sriov_err(gt, "Failed to reset GuC state (%pe)\n", ERR_PTR(err));
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-31 17:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  9:21 [PATCH] drm/xe/vf: Retry GuC state reset until timeout Lukasz Laguna
2026-08-31  9:45 ` K V P, Satyanarayana
2026-08-31 10:06 ` Michal Wajdeczko
2026-08-31 17:16   ` Laguna, Lukasz
2026-08-31 13:59 ` ✓ CI.KUnit: success for " Patchwork
2026-08-31 14:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-08-31 16:27 ` ✓ Xe.CI.FULL: " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox