Commit 89250fec authored by Imre Deak's avatar Imre Deak

drm/i915: Sanitize DMC/CSR ucode cleanup code

commit ebae38d0
Author: Animesh Manna <animesh.manna@intel.com>
Date:   Wed Oct 28 23:58:55 2015 +0200

    drm/i915/gen9: csr_init after runtime pm enable

moved the DMC/CSR initialization later during driver loading, but didn't
move the cleanup earlier correspondingly during unloading. Fix this up.
Signed-off-by: default avatarImre Deak <imre.deak@intel.com>
Reviewed-by: default avatarDavid Weinehall <david.weinehall@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1453209992-25995-2-git-send-email-imre.deak@intel.com
parent 9a15a873
...@@ -404,7 +404,7 @@ static int i915_load_modeset_init(struct drm_device *dev) ...@@ -404,7 +404,7 @@ static int i915_load_modeset_init(struct drm_device *dev)
ret = intel_irq_install(dev_priv); ret = intel_irq_install(dev_priv);
if (ret) if (ret)
goto cleanup_gem_stolen; goto cleanup_csr;
intel_setup_gmbus(dev); intel_setup_gmbus(dev);
...@@ -458,7 +458,8 @@ static int i915_load_modeset_init(struct drm_device *dev) ...@@ -458,7 +458,8 @@ static int i915_load_modeset_init(struct drm_device *dev)
intel_guc_ucode_fini(dev); intel_guc_ucode_fini(dev);
drm_irq_uninstall(dev); drm_irq_uninstall(dev);
intel_teardown_gmbus(dev); intel_teardown_gmbus(dev);
cleanup_gem_stolen: cleanup_csr:
intel_csr_ucode_fini(dev_priv);
i915_gem_cleanup_stolen(dev); i915_gem_cleanup_stolen(dev);
cleanup_vga_switcheroo: cleanup_vga_switcheroo:
vga_switcheroo_unregister_client(dev->pdev); vga_switcheroo_unregister_client(dev->pdev);
...@@ -945,7 +946,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -945,7 +946,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
ret = i915_gem_gtt_init(dev); ret = i915_gem_gtt_init(dev);
if (ret) if (ret)
goto out_freecsr; goto out_uncore_fini;
/* WARNING: Apparently we must kick fbdev drivers before vgacon, /* WARNING: Apparently we must kick fbdev drivers before vgacon,
* otherwise the vga fbdev driver falls over. */ * otherwise the vga fbdev driver falls over. */
...@@ -1115,8 +1116,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) ...@@ -1115,8 +1116,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
io_mapping_free(dev_priv->gtt.mappable); io_mapping_free(dev_priv->gtt.mappable);
out_gtt: out_gtt:
i915_global_gtt_cleanup(dev); i915_global_gtt_cleanup(dev);
out_freecsr: out_uncore_fini:
intel_csr_ucode_fini(dev_priv);
intel_uncore_fini(dev); intel_uncore_fini(dev);
pci_iounmap(dev->pdev, dev_priv->regs); pci_iounmap(dev->pdev, dev_priv->regs);
put_bridge: put_bridge:
...@@ -1182,6 +1182,8 @@ int i915_driver_unload(struct drm_device *dev) ...@@ -1182,6 +1182,8 @@ int i915_driver_unload(struct drm_device *dev)
vga_switcheroo_unregister_client(dev->pdev); vga_switcheroo_unregister_client(dev->pdev);
vga_client_register(dev->pdev, NULL, NULL, NULL); vga_client_register(dev->pdev, NULL, NULL, NULL);
intel_csr_ucode_fini(dev_priv);
/* Free error state after interrupts are fully disabled. */ /* Free error state after interrupts are fully disabled. */
cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work); cancel_delayed_work_sync(&dev_priv->gpu_error.hangcheck_work);
i915_destroy_error_state(dev); i915_destroy_error_state(dev);
...@@ -1202,8 +1204,6 @@ int i915_driver_unload(struct drm_device *dev) ...@@ -1202,8 +1204,6 @@ int i915_driver_unload(struct drm_device *dev)
intel_fbc_cleanup_cfb(dev_priv); intel_fbc_cleanup_cfb(dev_priv);
i915_gem_cleanup_stolen(dev); i915_gem_cleanup_stolen(dev);
intel_csr_ucode_fini(dev_priv);
intel_teardown_mchbar(dev); intel_teardown_mchbar(dev);
destroy_workqueue(dev_priv->hotplug.dp_wq); destroy_workqueue(dev_priv->hotplug.dp_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