[Intel-gfx] [PATCH v2 1/2] drm/i915/huc: Move pending status before debug

Tvrtko Ursulin tursulin at ursulin.net
Thu Mar 9 07:08:54 UTC 2017


From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

This avoids confusing log message sequences such as:

 [] i915/skl_huc_ver01_07_1398.bin fw status: fetch SUCCESS, load SUCCESS
 [] HuC DMA transfer wait over with ret 0
 [] i915/skl_huc_ver01_07_1398.bin fw status: fetch SUCCESS, load SUCCESS

v2:

Michal and Michał noticed that there is an impossible condition
introduced by v1, which is also preventing  second attempts of
firmware load after reset. This has now been removed.

I also removed the fetch status check on the fail path which
looks redundant as well.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa at intel.com>
Cc: Michał Winiarski <michal.winiarski at intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
I've just realized these two patches would create a conflict for
Arek's GuC/HuC tidy series. Feel free to incorporate them into
that work then if it is easier.

 drivers/gpu/drm/i915/intel_huc.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_huc.c b/drivers/gpu/drm/i915/intel_huc.c
index e660109fc51e..35124a257f20 100644
--- a/drivers/gpu/drm/i915/intel_huc.c
+++ b/drivers/gpu/drm/i915/intel_huc.c
@@ -213,17 +213,13 @@ int intel_huc_load(struct drm_i915_private *dev_priv)
 	if (huc_fw->fetch_status == INTEL_UC_FIRMWARE_NONE)
 		return 0;
 
+	huc_fw->load_status = INTEL_UC_FIRMWARE_PENDING;
+
 	DRM_DEBUG_DRIVER("%s fw status: fetch %s, load %s\n",
 		huc_fw->path,
 		intel_uc_fw_status_repr(huc_fw->fetch_status),
 		intel_uc_fw_status_repr(huc_fw->load_status));
 
-	if (huc_fw->fetch_status == INTEL_UC_FIRMWARE_SUCCESS &&
-	    huc_fw->load_status == INTEL_UC_FIRMWARE_FAIL)
-		return -ENOEXEC;
-
-	huc_fw->load_status = INTEL_UC_FIRMWARE_PENDING;
-
 	switch (huc_fw->fetch_status) {
 	case INTEL_UC_FIRMWARE_FAIL:
 		/* something went wrong :( */
@@ -259,8 +255,7 @@ int intel_huc_load(struct drm_i915_private *dev_priv)
 	return 0;
 
 fail:
-	if (huc_fw->load_status == INTEL_UC_FIRMWARE_PENDING)
-		huc_fw->load_status = INTEL_UC_FIRMWARE_FAIL;
+	huc_fw->load_status = INTEL_UC_FIRMWARE_FAIL;
 
 	DRM_ERROR("Failed to complete HuC uCode load with ret %d\n", err);
 
-- 
2.9.3



More information about the Intel-gfx mailing list