Skip to content

Commit

Permalink
drm/i915/guc: Flush context destruction worker at suspend
Browse files Browse the repository at this point in the history
When suspending, flush the context-guc-id
deregistration worker at the final stages of
intel_gt_suspend_late when we finally call gt_sanitize
that eventually leads down to __uc_sanitize so that
the deregistration worker doesn't fire off later as
we reset the GuC microcontroller.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Tested-by: Mousumi Jana <mousumi.jana@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231228045558.536585-2-alan.previn.teres.alexis@intel.com
  • Loading branch information
Alan Previn authored and Matt Roper committed Jan 9, 2024
1 parent a797099 commit 5e83c06
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
Original file line number Diff line number Diff line change
Expand Up @@ -1613,6 +1613,11 @@ static void guc_flush_submissions(struct intel_guc *guc)
spin_unlock_irqrestore(&sched_engine->lock, flags);
}

void intel_guc_submission_flush_work(struct intel_guc *guc)
{
flush_work(&guc->submission_state.destroyed_worker);
}

static void guc_flush_destroyed_contexts(struct intel_guc *guc);

void intel_guc_submission_reset_prepare(struct intel_guc *guc)
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ int intel_guc_wait_for_pending_msg(struct intel_guc *guc,
bool interruptible,
long timeout);

void intel_guc_submission_flush_work(struct intel_guc *guc);

static inline bool intel_guc_submission_is_supported(struct intel_guc *guc)
{
return guc->submission_supported;
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/gt/uc/intel_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ void intel_uc_suspend(struct intel_uc *uc)
return;
}

intel_guc_submission_flush_work(guc);

with_intel_runtime_pm(&uc_to_gt(uc)->i915->runtime_pm, wakeref) {
err = intel_guc_suspend(guc);
if (err)
Expand Down

0 comments on commit 5e83c06

Please sign in to comment.