[PATCH v3 3/4] drm/i915/uc: Release GuC/HuC firmware on WOPCM partitioning failure.

Jackie Li yaodong.li at intel.com
Tue Dec 5 18:23:21 UTC 2017

GuC/HuC firmware won't be used if failed to create WOPCM partitions
because we won't be able to load firmwares without valid WOPCM
partition setting for GuC and HuC.

This patch call intel_uc_fini_fw() to release the GuC/HuC firmware
memory if the WOPCM partitioning failed.

Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
Signed-off-by: Jackie Li <yaodong.li at intel.com>
 drivers/gpu/drm/i915/intel_uc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 099c7ce..e788c2f 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -175,7 +175,10 @@ void intel_uc_init_fw(struct drm_i915_private *dev_priv)
 	intel_uc_fw_fetch(dev_priv, &dev_priv->huc.fw);
 	intel_uc_fw_fetch(dev_priv, &dev_priv->guc.fw);
-	intel_uc_wopcm_partition_init(dev_priv);
+	/* Firmwares will not be used if WOPCM partitioning failed. */
+	if (intel_uc_wopcm_partition_init(dev_priv))
+		intel_uc_fini_fw(dev_priv);
 void intel_uc_fini_fw(struct drm_i915_private *dev_priv)

More information about the Intel-gfx-trybot mailing list