diff mbox

[v2] drm/i915/guc: Clear enable_guc_loading in case of init failure

Message ID 20170605171251.9905-1-michel.thierry@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michel Thierry June 5, 2017, 5:12 p.m. UTC
And prevent calling i915_ggtt_disable_guc twice (the first when GuC init
failed, and the second time during driver unload / intel_uc_fini_hw),
and hitting the GEM_BUG_ON.

v2: Clear enable_guc_loading unconditionally (Michal)
    Make sure guc_free_load_err_log is still called (Daniele)
    Don't shoot the messenger (Chris)

Fixes: 3950bf3dbff10 ("drm/i915/guc: Add onion teardown to the GuC
setup")
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Michal Wajdeczko June 5, 2017, 5:20 p.m. UTC | #1
On Mon, Jun 05, 2017 at 10:12:51AM -0700, Michel Thierry wrote:
> And prevent calling i915_ggtt_disable_guc twice (the first when GuC init
> failed, and the second time during driver unload / intel_uc_fini_hw),
> and hitting the GEM_BUG_ON.
> 
> v2: Clear enable_guc_loading unconditionally (Michal)
>     Make sure guc_free_load_err_log is still called (Daniele)
>     Don't shoot the messenger (Chris)
> 
> Fixes: 3950bf3dbff10 ("drm/i915/guc: Add onion teardown to the GuC
> setup")
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Michel Thierry <michel.thierry@intel.com>
> ---

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

-Michal
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 3524ff07a0f2..a8930f2feacf 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -433,16 +433,19 @@  int intel_uc_init_hw(struct drm_i915_private *dev_priv)
 		DRM_NOTE("Falling back from GuC submission to execlist mode\n");
 	}
 
+	i915.enable_guc_loading = 0;
+	DRM_NOTE("GuC firmware loading disabled\n");
+
 	return ret;
 }
 
 void intel_uc_fini_hw(struct drm_i915_private *dev_priv)
 {
+	guc_free_load_err_log(&dev_priv->guc);
+
 	if (!i915.enable_guc_loading)
 		return;
 
-	guc_free_load_err_log(&dev_priv->guc);
-
 	if (i915.enable_guc_submission)
 		i915_guc_submission_disable(dev_priv);