drm/i915/uc: Do full sanitize instead of pure reset
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Fri, 2 Aug 2019 18:40:51 +0000 (18:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 2 Aug 2019 20:14:32 +0000 (21:14 +0100)
On Gen9 when we try to reload HuC due to GuC upload error, we hit:

<7> [229.656688] [drm:intel_uc_init_hw [i915]] GuC fw load failed: -8; will reset and retry 2 more time(s)
<7> [229.656739] [drm:intel_uc_fw_upload [i915]] HuC fw load i915/kbl_huc_ver02_00_1810.bin
<3> [229.656740] intel_uc_fw_upload:425 GEM_BUG_ON(intel_uc_fw_is_loaded(uc_fw))

as we performed only pure reset and didn't sanitized HuC fw status.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190802184055.31988-3-michal.wajdeczko@intel.com
drivers/gpu/drm/i915/gt/uc/intel_uc.c

index d1b08b28b1ad550c1fc131331abdf0a91a7d3a81..f24860a86d0e65a8f757fec178fb58693db601ca 100644 (file)
@@ -340,7 +340,7 @@ void intel_uc_fini(struct intel_uc *uc)
        intel_guc_fini(guc);
 }
 
-static void __uc_sanitize(struct intel_uc *uc)
+static int __uc_sanitize(struct intel_uc *uc)
 {
        struct intel_guc *guc = &uc->guc;
        struct intel_huc *huc = &uc->huc;
@@ -350,7 +350,7 @@ static void __uc_sanitize(struct intel_uc *uc)
        intel_huc_sanitize(huc);
        intel_guc_sanitize(guc);
 
-       __intel_uc_reset_hw(uc);
+       return __intel_uc_reset_hw(uc);
 }
 
 void intel_uc_sanitize(struct intel_uc *uc)
@@ -434,7 +434,7 @@ int intel_uc_init_hw(struct intel_uc *uc)
                 * Always reset the GuC just before (re)loading, so
                 * that the state and timing are fairly predictable
                 */
-               ret = __intel_uc_reset_hw(uc);
+               ret = __uc_sanitize(uc);
                if (ret)
                        goto err_out;