drm/i915/gt: Move gt_cleanup_early out of gem_cleanup_early
authorDaniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Thu, 1 Aug 2019 00:57:07 +0000 (17:57 -0700)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 1 Aug 2019 16:58:50 +0000 (17:58 +0100)
We don't call the init_early function from within the gem code, so we
shouldn't do it for the cleanup either.

v2: while at it, s/gt_cleanup_early/gt_late_release (Chris)
v3: s/late_release/driver_late_release/ (Chris)

Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> #v1
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/20190801005709.34092-1-daniele.ceraolospurio@intel.com
drivers/gpu/drm/i915/gt/intel_gt.c
drivers/gpu/drm/i915/gt/intel_gt.h
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_gem.c

index caa07eb20a64475eaa269a593683d12ec39b5ef4..720f0cab7aae2b1c14cc7f1add410e71f5db7217 100644 (file)
@@ -260,7 +260,7 @@ void intel_gt_fini_scratch(struct intel_gt *gt)
        i915_vma_unpin_and_release(&gt->scratch, 0);
 }
 
-void intel_gt_cleanup_early(struct intel_gt *gt)
+void intel_gt_driver_late_release(struct intel_gt *gt)
 {
        intel_gt_fini_reset(gt);
 }
index 640bb0531f5b52a523ab2a91f21addb49301972c..4920cb351f1093212b5b06a4809c1b4d63f5d4e3 100644 (file)
@@ -30,7 +30,7 @@ static inline struct intel_gt *huc_to_gt(struct intel_huc *huc)
 void intel_gt_init_early(struct intel_gt *gt, struct drm_i915_private *i915);
 void intel_gt_init_hw(struct drm_i915_private *i915);
 
-void intel_gt_cleanup_early(struct intel_gt *gt);
+void intel_gt_driver_late_release(struct intel_gt *gt);
 
 void intel_gt_check_and_clear_faults(struct intel_gt *gt);
 void intel_gt_clear_error_registers(struct intel_gt *gt,
index 08c5504e040c6fdb407b2fae23890e9ba647cf98..6381f7b1e8581d80d502a379773a4287b03578d9 100644 (file)
@@ -951,6 +951,7 @@ err_uc:
        intel_uc_cleanup_early(&dev_priv->gt.uc);
        i915_gem_cleanup_early(dev_priv);
 err_workqueues:
+       intel_gt_driver_late_release(&dev_priv->gt);
        i915_workqueues_cleanup(dev_priv);
        return ret;
 }
@@ -966,6 +967,7 @@ static void i915_driver_late_release(struct drm_i915_private *dev_priv)
        intel_power_domains_cleanup(dev_priv);
        intel_uc_cleanup_early(&dev_priv->gt.uc);
        i915_gem_cleanup_early(dev_priv);
+       intel_gt_driver_late_release(&dev_priv->gt);
        i915_workqueues_cleanup(dev_priv);
 
        pm_qos_remove_request(&dev_priv->sb_qos);
index 62eefe860bcdc4a07aa9ef9babd8b21ad60b6feb..e779dba2e5a33a1abd29cc43786b921bb090fb44 100644 (file)
@@ -1689,8 +1689,6 @@ void i915_gem_cleanup_early(struct drm_i915_private *dev_priv)
        GEM_BUG_ON(atomic_read(&dev_priv->mm.free_count));
        WARN_ON(dev_priv->mm.shrink_count);
 
-       intel_gt_cleanup_early(&dev_priv->gt);
-
        i915_gemfs_fini(dev_priv);
 }