[Intel-gfx] [PATCH] drm/i915/guc: Fix detection of GuC submission in use

Janusz Krzysztofik janusz.krzysztofik at linux.intel.com
Thu Sep 5 11:16:31 UTC 2019


The driver always assumes active GuC submission mode if it is
supported.  That's not true if GuC initialization fails for some
reason.  That may lead to kernel panics, caused e.g. by execlists
fallback submission mode incorrectly detecting GuC submission in use.

Fix it by also checking for GuC enabled status.

Fixes: 356c484822e6 ("drm/i915/uc: Add explicit DISABLED state for firmware")
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik at linux.intel.com>
---
 drivers/gpu/drm/i915/gt/uc/intel_uc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc.h b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
index 527995c21196..b28bab64a280 100644
--- a/drivers/gpu/drm/i915/gt/uc/intel_uc.h
+++ b/drivers/gpu/drm/i915/gt/uc/intel_uc.h
@@ -51,7 +51,8 @@ static inline bool intel_uc_supports_guc_submission(struct intel_uc *uc)
 
 static inline bool intel_uc_uses_guc_submission(struct intel_uc *uc)
 {
-	return intel_guc_is_submission_supported(&uc->guc);
+	return intel_guc_is_enabled(&uc->guc) &&
+	       intel_guc_is_submission_supported(&uc->guc);
 }
 
 static inline bool intel_uc_supports_huc(struct intel_uc *uc)
-- 
2.21.0



More information about the Intel-gfx mailing list