[PATCH 1/2] drm/i915/huc: Give the GuC a second chance to authenticate the HuC

Michal Wajdeczko michal.wajdeczko at intel.com
Mon Jun 24 16:54:11 UTC 2019


Should help for cases when GuC forgets what to do.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko at intel.com>
---
 drivers/gpu/drm/i915/intel_huc.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index fb6f693d3cac..fb534c58aa64 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -122,6 +122,7 @@ int intel_huc_auth(struct intel_huc *huc)
 {
 	struct drm_i915_private *i915 = huc_to_i915(huc);
 	struct intel_guc *guc = &i915->guc;
+	bool retry = true;
 	int ret;
 
 	if (huc->fw.load_status != INTEL_UC_FIRMWARE_SUCCESS)
@@ -134,12 +135,20 @@ int intel_huc_auth(struct intel_huc *huc)
 		goto fail;
 	}
 
+again:
 	/* Check authentication status, it should be done by now */
 	ret = __intel_wait_for_register(&i915->uncore,
 					huc->status.reg,
 					huc->status.mask,
 					huc->status.value,
 					2, 50, NULL);
+	/* GuC 32.x may need additional reminder to authenticate the HuC */
+	if (unlikely(ret) && retry) {
+		DRM_DEBUG_DRIVER("HuC: Firmware not verified %d\n", -EAGAIN);
+		intel_guc_notify(guc);
+		retry = false;
+		goto again;
+	}
 	if (ret) {
 		DRM_ERROR("HuC: Firmware not verified %d\n", ret);
 		goto fail;
-- 
2.19.2



More information about the Intel-gfx-trybot mailing list