Re: [PATCH v2 6/7] drm/i915/huc: Load HuC only if requested

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/1/2017 4:03 PM, Michal Wajdeczko wrote:
Our new "enable_guc" modparam allows to control whenever HuC
should be loaded. However existing code will try load and
authenticate HuC always when we use the GuC. This patch is
trying to enforce modparam selection.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
Cc: Sagar Arun Kamble <sagar.a.kamble@xxxxxxxxx>
<snip>
  int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  {
  	struct intel_guc *guc = &dev_priv->guc;
+	struct intel_huc *huc = &dev_priv->huc;
  	int ret, attempts;
if (!USES_GUC(dev_priv))
@@ -220,7 +221,12 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  		if (ret)
  			goto err_submission;
- intel_huc_init_hw(&dev_priv->huc);
+		if (USES_HUC(dev_priv)) {
+			ret = intel_huc_init_hw(huc);
+			if (ret)
+				break;
this break should be "goto err_submission" as GuC is still not ready.
looks like user has to be very careful with param now that HuC failure can block GuC tasks too.
+		}
+
  		intel_guc_init_params(guc);
  		ret = intel_guc_fw_upload(guc);
  		if (ret == 0 || ret != -EAGAIN)
@@ -238,7 +244,12 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  	if (ret)
  		goto err_log_capture;
- intel_huc_auth(&dev_priv->huc);
+	if (USES_HUC(dev_priv)) {
+		ret = intel_huc_auth(huc);
+		if (ret)
+			goto err_interrupts;
+	}
+
  	if (USES_GUC_SUBMISSION(dev_priv)) {
  		if (i915_modparams.guc_log_level >= 0)
  			gen9_enable_guc_interrupts(dev_priv);
@@ -252,6 +263,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)
  		 guc->fw.major_ver_found, guc->fw.minor_ver_found);
  	dev_info(dev_priv->drm.dev, "GuC submission %s\n",
  		 enableddisabled(USES_GUC_SUBMISSION(dev_priv)));
+	dev_info(dev_priv->drm.dev, "HuC %s\n",
+		 enableddisabled(USES_HUC(dev_priv)));
return 0;

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux