drm/i915/guc: Flush context destruction worker at suspend
authorAlan Previn <alan.previn.teres.alexis@intel.com>
Thu, 28 Dec 2023 04:55:57 +0000 (20:55 -0800)
committerMatt Roper <matthew.d.roper@intel.com>
Tue, 9 Jan 2024 17:33:07 +0000 (09:33 -0800)
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
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.h
drivers/gpu/drm/i915/gt/uc/intel_uc.c

index a259f1118c5ab1f660d506e4719a8b54a7a6fcc8..9c64ae0766cc0f9e5ba3286b6994acfe83c27da4 100644 (file)
@@ -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)
index c57b29cdb1a64eeb2057101e7d59d0ec761d74c9..b6df75622d3b9fa777ebb6f7a4f4cc8a285cd6f9 100644 (file)
@@ -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;
index 3872d309ed31fa6a313bd7d0d72f3e5ccde679ec..b8b09b1bee3eaaa02e33e1827a24cad6eac8708d 100644 (file)
@@ -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)