Commit d88b01d0 authored by Chris Wilson's avatar Chris Wilson Committed by Greg Kroah-Hartman

drm/i915: Cleanup gt powerstate from gem

[ Upstream commit 30b71084 ]

Since the gt powerstate is allocated by i915_gem_init, clean it from
i915_gem_fini for symmetry and to correct the imbalance on error.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180812223642.24865-1-chris@chris-wilson.co.ukSigned-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b185bde5
...@@ -5624,6 +5624,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv) ...@@ -5624,6 +5624,7 @@ int i915_gem_init(struct drm_i915_private *dev_priv)
void i915_gem_fini(struct drm_i915_private *dev_priv) void i915_gem_fini(struct drm_i915_private *dev_priv)
{ {
i915_gem_suspend_late(dev_priv); i915_gem_suspend_late(dev_priv);
intel_disable_gt_powersave(dev_priv);
/* Flush any outstanding unpin_work. */ /* Flush any outstanding unpin_work. */
i915_gem_drain_workqueue(dev_priv); i915_gem_drain_workqueue(dev_priv);
...@@ -5635,6 +5636,8 @@ void i915_gem_fini(struct drm_i915_private *dev_priv) ...@@ -5635,6 +5636,8 @@ void i915_gem_fini(struct drm_i915_private *dev_priv)
i915_gem_contexts_fini(dev_priv); i915_gem_contexts_fini(dev_priv);
mutex_unlock(&dev_priv->drm.struct_mutex); mutex_unlock(&dev_priv->drm.struct_mutex);
intel_cleanup_gt_powersave(dev_priv);
intel_uc_fini_misc(dev_priv); intel_uc_fini_misc(dev_priv);
i915_gem_cleanup_userptr(dev_priv); i915_gem_cleanup_userptr(dev_priv);
......
...@@ -15972,8 +15972,6 @@ void intel_modeset_cleanup(struct drm_device *dev) ...@@ -15972,8 +15972,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
flush_work(&dev_priv->atomic_helper.free_work); flush_work(&dev_priv->atomic_helper.free_work);
WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list)); WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
intel_disable_gt_powersave(dev_priv);
/* /*
* Interrupts and polling as the first thing to avoid creating havoc. * Interrupts and polling as the first thing to avoid creating havoc.
* Too much stuff here (turning of connectors, ...) would * Too much stuff here (turning of connectors, ...) would
...@@ -16001,8 +15999,6 @@ void intel_modeset_cleanup(struct drm_device *dev) ...@@ -16001,8 +15999,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
intel_cleanup_overlay(dev_priv); intel_cleanup_overlay(dev_priv);
intel_cleanup_gt_powersave(dev_priv);
intel_teardown_gmbus(dev_priv); intel_teardown_gmbus(dev_priv);
destroy_workqueue(dev_priv->modeset_wq); destroy_workqueue(dev_priv->modeset_wq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment