drm/xe/multi_queue: track and recover lost CGP updates across VF migration

When a CGP_SYNC (or REGISTER_CONTEXT_MULTI_QUEUE with CGP) is in flight
during VF migration, GuC loses the message and never sends CGP_SYNC_DONE.
Two failure modes exist:

1. The send was already issued (CGP_SYNC_DONE not received):
   group->sync_pending stays set and cgp_update_q points to the queue
   that owns the outstanding sync.

2. The wait woke early (send not issued):
   The queue returned from xe_guc_exec_queue_group_cgp_sync() without
   sending after vf_recovery() became true.

Track which kind of sync is outstanding (registering_cgp / updating_cgp)
and the owning queue (cgp_update_q) so
guc_exec_queue_revert_pending_state_change()
can recover both cases:
- A registration-time CGP bails or is lost  → clear registered flag so
  run_job re-registers after unpause (re_register / registering_cgp paths).
- A dynamic CGP update bails or is lost → set needs_cgp_sync so replay
  re-issues the update after unpause (re_update / updating_cgp paths).

Tag all registration call sites with CGP_SYNC_REGISTRATION so the bail
path distinguishes them from dynamic updates.

Assisted-by: Github-Copilot:Claude-opus-4.8
Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Link: https://patch.msgid.link/20260803230528.3428029-9-niranjana.vishwanathapura@intel.com
This commit is contained in:
Niranjana Vishwanathapura 2026-08-03 16:05:32 -07:00
commit 116a19d83e
3 changed files with 141 additions and 8 deletions