drm/i915/guc: Add uc_fini_wq in gem_init unwind path

"Linux Kernel Mailing List" <[email protected]>
Newsgroups gmane.linux.kernel.commits.head
Message-ID <[email protected]>
Web:        https://git.kernel.org/torvalds/c/c950af50e5983a119bebedceed94ef505df8d552
Commit:     c950af50e5983a119bebedceed94ef505df8d552
Parent:     6389902072db658366ec53711a83d711364b7330
Refname:    refs/heads/master
Author:     Sagar Arun Kamble <[email protected]>
AuthorDate: Wed Jan 10 18:24:16 2018 +0530
Committer:  Rodrigo Vivi <[email protected]>
CommitDate: Thu Feb 1 07:31:33 2018 -0800

    drm/i915/guc: Add uc_fini_wq in gem_init unwind path
    
    While moving code around for solving lockdep issue for GuC log relay,
    spotted that uc_fini_wq is not being called in failure path in gem_init.
    Missed in the below commit. Add it.
    
    v2: Removed GEM_BUG_ON(!HAS_GUC()) from intel_uc_fini_wq as init happens
    only based on enable_guc module parameter and does not consider has_guc
    capability. (Michal)
    
    Signed-off-by: Sagar Arun Kamble <[email protected]>
    Fixes: 3176ff49bc3e ("drm/i915/guc: Move GuC workqueue allocations outside of the mutex")
    Cc: Michał Winiarski <[email protected]>
    Cc: Chris Wilson <[email protected]>
    Reviewed-by: Michał Winiarski <[email protected]>
    Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
    Signed-off-by: Chris Wilson <[email protected]>
    (cherry picked from commit da943b5ab071584fcb9cfa896dc8c643d376f362)
    Signed-off-by: Rodrigo Vivi <[email protected]>
---
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 drivers/gpu/drm/i915/intel_uc.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 8bc3283484be..1135a77b383a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -5283,6 +5283,8 @@ err_unlock:
 	intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
 	mutex_unlock(&dev_priv->drm.struct_mutex);
 
+	intel_uc_fini_wq(dev_priv);
+
 	if (ret != -EIO)
 		i915_gem_cleanup_userptr(dev_priv);
 
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 907deac6e3fa..d82ca0f438f5 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -209,8 +209,6 @@ void intel_uc_fini_wq(struct drm_i915_private *dev_priv)
 	if (!USES_GUC(dev_priv))
 		return;
 
-	GEM_BUG_ON(!HAS_GUC(dev_priv));
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.