[Intel-gfx] [PATCH 2/2] drm/i915: Remove early invocations of i915_engines_cleanup()

Chris Wilson chris at chris-wilson.co.uk
Sat Oct 7 08:56:59 UTC 2017


Engines are now only allocated during init_mmio, so we can forgo
iterating over the empty list and calling kfree(NULL) prior to
intel_engines_init_mmio().

Fixes: 63ffbcdadcf2 ("drm/i915: Sanitize engine context sizes")
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 7d110797e0dc..a45e34dcd04d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -818,15 +818,6 @@ static int i915_workqueues_init(struct drm_i915_private *dev_priv)
 	return -ENOMEM;
 }
 
-static void i915_engines_cleanup(struct drm_i915_private *i915)
-{
-	struct intel_engine_cs *engine;
-	enum intel_engine_id id;
-
-	for_each_engine(engine, i915, id)
-		kfree(engine);
-}
-
 static void i915_workqueues_cleanup(struct drm_i915_private *dev_priv)
 {
 	destroy_workqueue(dev_priv->hotplug.dp_wq);
@@ -900,7 +891,7 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
 
 	ret = i915_workqueues_init(dev_priv);
 	if (ret < 0)
-		goto err_engines;
+		goto err;
 
 	i915_memcpy_init_early(dev_priv);
 
@@ -935,8 +926,7 @@ static int i915_driver_init_early(struct drm_i915_private *dev_priv,
 err_irq:
 	intel_irq_fini(dev_priv);
 	i915_workqueues_cleanup(dev_priv);
-err_engines:
-	i915_engines_cleanup(dev_priv);
+err:
 	return ret;
 }
 
@@ -950,7 +940,6 @@ static void i915_driver_cleanup_early(struct drm_i915_private *dev_priv)
 	i915_gem_load_cleanup(dev_priv);
 	intel_irq_fini(dev_priv);
 	i915_workqueues_cleanup(dev_priv);
-	i915_engines_cleanup(dev_priv);
 }
 
 static int i915_mmio_setup(struct drm_i915_private *dev_priv)
-- 
2.14.2



More information about the Intel-gfx mailing list