From 7319c2ceb2d74d54f24b7f5409b97aed406f0189 Mon Sep 17 00:00:00 2001 From: Satyanarayana K V P Date: Wed, 10 Dec 2025 05:25:49 +0000 Subject: [PATCH] drm/xe/vf: Reset recovery_queued after issuing RESFIX_START During VF_RESTORE or VF_RESUME, the GuC sends a migration interrupt and clears the RESFIX_START marker. If migration or resume occurs before the VF issues its own RESFIX_START, VF KMD may receive two back-to-back migration interrupts. VF then sends RESFIX_START to indicate the beginning of fixups and RESFIX_DONE to mark completion. However, the second RESFIX_START fails because the GuC is already in the RUNNING state. Clear the recovery_queued flag after sending a RESFIX_START message to ignore duplicated IRQs seen before we start actual recovery. This ensures the state is reset only after the fixup process begins, avoiding redundant work item queuing. Fixes: b5fbb94341a2 ("drm/xe/vf: Introduce RESFIX start marker support") Signed-off-by: Satyanarayana K V P Cc: Michal Wajdeczko Cc: Matthew Brost Cc: Tomasz Lis Reviewed-by: Matthew Brost Reviewed-by: Michal Wajdeczko Signed-off-by: Michal Wajdeczko Link: https://patch.msgid.link/20251210052546.622809-6-satyanarayana.k.v.p@intel.com --- drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c index 47612e67d462..b8b391cfc8eb 100644 --- a/drivers/gpu/drm/xe/xe_gt_sriov_vf.c +++ b/drivers/gpu/drm/xe/xe_gt_sriov_vf.c @@ -1171,10 +1171,6 @@ static bool vf_post_migration_shutdown(struct xe_gt *gt) return true; } - spin_lock_irq(>->sriov.vf.migration.lock); - gt->sriov.vf.migration.recovery_queued = false; - spin_unlock_irq(>->sriov.vf.migration.lock); - xe_guc_ct_flush_and_stop(>->uc.guc.ct); xe_guc_submit_pause_vf(>->uc.guc); xe_tlb_inval_reset(>->tlb_inval); @@ -1258,7 +1254,14 @@ static int vf_post_migration_resfix_done(struct xe_gt *gt, u16 marker) static int vf_post_migration_resfix_start(struct xe_gt *gt, u16 marker) { - return vf_resfix_start(gt, marker); + int err; + + err = vf_resfix_start(gt, marker); + + guard(spinlock_irq) (>->sriov.vf.migration.lock); + gt->sriov.vf.migration.recovery_queued = false; + + return err; } static u16 vf_post_migration_next_resfix_marker(struct xe_gt *gt) -- 2.47.3