@@ -1208,6 +1208,12 @@ static void __guc_client_disable(struct intel_guc_client *client)
guc_proc_desc_fini(client);
}
+static void __guc_client_stop(struct intel_guc_client *client)
+{
+ __fini_doorbell(client);
+ __update_doorbell_desc(client, GUC_DOORBELL_INVALID);
+}
+
static int guc_clients_enable(struct intel_guc *guc)
{
int ret;
@@ -1236,6 +1242,15 @@ static void guc_clients_disable(struct intel_guc *guc)
__guc_client_disable(guc->execbuf_client);
}
+static void guc_clients_stop(struct intel_guc *guc)
+{
+ if (guc->preempt_client)
+ __guc_client_stop(guc->preempt_client);
+
+ if (guc->execbuf_client)
+ __guc_client_stop(guc->execbuf_client);
+}
+
/*
* Set up the memory resources to be shared with the GuC (via the GGTT)
* at firmware loading time.
@@ -1455,6 +1470,16 @@ void intel_guc_submission_disable(struct intel_guc *guc)
guc_clients_disable(guc);
}
+void intel_guc_submission_stop(struct intel_guc *guc)
+{
+ struct drm_i915_private *i915 = guc_to_i915(guc);
+
+ GEM_BUG_ON(i915->gt.awake); /* GT should be parked first */
+
+ guc_interrupts_release(i915);
+ guc_clients_stop(guc);
+}
+
#if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#include "selftests/intel_guc.c"
#endif
@@ -81,6 +81,7 @@ struct intel_guc_client {
int intel_guc_submission_init(struct intel_guc *guc);
int intel_guc_submission_enable(struct intel_guc *guc);
+void intel_guc_submission_stop(struct intel_guc *guc);
void intel_guc_submission_disable(struct intel_guc *guc);
void intel_guc_submission_fini(struct intel_guc *guc);
int intel_guc_preempt_work_create(struct intel_guc *guc);
@@ -502,6 +502,9 @@ void intel_uc_reset_prepare(struct drm_i915_private *i915)
if (!intel_guc_is_alive(guc))
return;
+ if (USES_GUC_SUBMISSION(i915))
+ intel_guc_submission_stop(guc);
+
guc_stop_communication(guc);
__uc_sanitize(i915);
}
Knowing that GuC will be reset soon, perform only minimal cleanup actions (ie. doorbells) without talking with GuC. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> --- drivers/gpu/drm/i915/intel_guc_submission.c | 25 +++++++++++++++++++++ drivers/gpu/drm/i915/intel_guc_submission.h | 1 + drivers/gpu/drm/i915/intel_uc.c | 3 +++ 3 files changed, 29 insertions(+)