From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx> 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@xxxxxxxxx> Cc: Anusha Srivatsa <anusha.srivatsa@xxxxxxxxx> Cc: Michał Winiarski <michal.winiarski@xxxxxxxxx> Cc: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx> Cc: Arkadiusz Hiler <arkadiusz.hiler@xxxxxxxxx> --- 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 _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx