aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-05 10:22:16 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-06 16:19:54 -0400
commit4c2e0990ade3251c9b5770aa8f06b06375b66f9f (patch)
treed5418701e4fec560cd2b285f1f8f7f74e2a3619c
parentf418f2ec440ab8c014f37539ef0b19271afb1186 (diff)
drm/i915: Fixup global gtt cleanup
The global gtt is setup up in 2 parts, so we need to be careful with the cleanup. For consistency shovel it all into the ->cleanup callback, like with ppgtt. Noticed because it blew up in the out_gtt: cleanup code while fiddling with the vgacon code. Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c4
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c9
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index b9159ade5e85..27fe65ac5940 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1386,7 +1386,6 @@ cleanup_gem:
1386 i915_gem_context_fini(dev); 1386 i915_gem_context_fini(dev);
1387 mutex_unlock(&dev->struct_mutex); 1387 mutex_unlock(&dev->struct_mutex);
1388 WARN_ON(dev_priv->mm.aliasing_ppgtt); 1388 WARN_ON(dev_priv->mm.aliasing_ppgtt);
1389 drm_mm_takedown(&dev_priv->gtt.base.mm);
1390cleanup_irq: 1389cleanup_irq:
1391 drm_irq_uninstall(dev); 1390 drm_irq_uninstall(dev);
1392cleanup_gem_stolen: 1391cleanup_gem_stolen:
@@ -1756,8 +1755,6 @@ out_mtrrfree:
1756 arch_phys_wc_del(dev_priv->gtt.mtrr); 1755 arch_phys_wc_del(dev_priv->gtt.mtrr);
1757 io_mapping_free(dev_priv->gtt.mappable); 1756 io_mapping_free(dev_priv->gtt.mappable);
1758out_gtt: 1757out_gtt:
1759 list_del(&dev_priv->gtt.base.global_link);
1760 drm_mm_takedown(&dev_priv->gtt.base.mm);
1761 dev_priv->gtt.base.cleanup(&dev_priv->gtt.base); 1758 dev_priv->gtt.base.cleanup(&dev_priv->gtt.base);
1762out_regs: 1759out_regs:
1763 intel_uncore_fini(dev); 1760 intel_uncore_fini(dev);
@@ -1846,7 +1843,6 @@ int i915_driver_unload(struct drm_device *dev)
1846 i915_free_hws(dev); 1843 i915_free_hws(dev);
1847 } 1844 }
1848 1845
1849 list_del(&dev_priv->gtt.base.global_link);
1850 WARN_ON(!list_empty(&dev_priv->vm_list)); 1846 WARN_ON(!list_empty(&dev_priv->vm_list));
1851 1847
1852 drm_vblank_cleanup(dev); 1848 drm_vblank_cleanup(dev);
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 931b906f292a..41e864ec5632 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1985,7 +1985,10 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
1985 1985
1986 struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base); 1986 struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
1987 1987
1988 drm_mm_takedown(&vm->mm); 1988 if (drm_mm_initialized(&vm->mm)) {
1989 drm_mm_takedown(&vm->mm);
1990 list_del(&vm->global_link);
1991 }
1989 iounmap(gtt->gsm); 1992 iounmap(gtt->gsm);
1990 teardown_scratch_page(vm->dev); 1993 teardown_scratch_page(vm->dev);
1991} 1994}
@@ -2018,6 +2021,10 @@ static int i915_gmch_probe(struct drm_device *dev,
2018 2021
2019static void i915_gmch_remove(struct i915_address_space *vm) 2022static void i915_gmch_remove(struct i915_address_space *vm)
2020{ 2023{
2024 if (drm_mm_initialized(&vm->mm)) {
2025 drm_mm_takedown(&vm->mm);
2026 list_del(&vm->global_link);
2027 }
2021 intel_gmch_remove(); 2028 intel_gmch_remove();
2022} 2029}
2023 2030