[PATCH 2/2] drm/i915/uc: stop communication

Fernando Pacheco fernando.pacheco at intel.com
Tue Aug 20 23:40:55 UTC 2019


Signed-off-by: Fernando Pacheco <fernando.pacheco at intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.c | 31 ++++++++++++++-------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.c b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
index 1e4b43e48a15..b8ee05b8ef08 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.c
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.c
@@ -224,29 +224,28 @@ static int guc_enable_communication(struct intel_guc *guc)
 	return 0;
 }
 
-static void guc_stop_communication(struct intel_guc *guc)
+static void __guc_stop_communication(struct intel_guc *guc)
 {
-	intel_guc_ct_stop(&guc->ct);
+	guc_clear_mmio_msg(guc);
+
+	guc_disable_interrupts(guc);
 
 	guc->send = intel_guc_send_nop;
 	guc->handler = intel_guc_to_host_event_handler_nop;
-
-	guc_clear_mmio_msg(guc);
 }
 
-static void guc_disable_communication(struct intel_guc *guc)
+static void guc_stop_communication(struct intel_guc *guc)
 {
-	/*
-	 * Events generated during or after CT disable are logged by guc in
-	 * via mmio. Make sure the register is clear before disabling CT since
-	 * all events we cared about have already been processed via CT.
-	 */
-	guc_clear_mmio_msg(guc);
+	intel_guc_ct_stop(&guc->ct);
 
-	guc_disable_interrupts(guc);
+	__guc_stop_communication(guc);
 
-	guc->send = intel_guc_send_nop;
-	guc->handler = intel_guc_to_host_event_handler_nop;
+	DRM_INFO("GuC communication stopped\n");
+}
+
+static void guc_disable_communication(struct intel_guc *guc)
+{
+	__guc_stop_communication(guc);
 
 	intel_guc_ct_disable(&guc->ct);
 
@@ -537,7 +536,9 @@ void intel_uc_fini_hw(struct intel_uc *uc)
 	if (intel_uc_supports_guc_submission(uc))
 		intel_guc_submission_disable(guc);
 
-	guc_disable_communication(guc);
+	if (guc_communication_enabled(guc))
+		guc_disable_communication(guc);
+
 	__uc_sanitize(uc);
 }
 
-- 
2.22.1



More information about the Intel-gfx-trybot mailing list