drm/i915: unregister interfaces first in unload
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Jul 2017 22:46:56 +0000 (00:46 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 19 Jul 2017 12:29:25 +0000 (14:29 +0200)
We first need to make sure no one else can get at us anymore,
before we can proceed to tear down all the datastructures.

Just a small step towards eventually the perfect unload code ...

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20170714224656.6431-3-daniel.vetter@ffwll.ch
drivers/gpu/drm/i915/i915_drv.c

index ffeb3a3bed5867676b65867576fbc39a548befb6..f406aec8a499cde3a20b081ef8278cd83e63cff9 100644 (file)
@@ -1375,6 +1375,8 @@ void i915_driver_unload(struct drm_device *dev)
        struct drm_i915_private *dev_priv = to_i915(dev);
        struct pci_dev *pdev = dev_priv->drm.pdev;
 
+       i915_driver_unregister(dev_priv);
+
        if (i915_gem_suspend(dev_priv))
                DRM_ERROR("failed to idle hardware; continuing to unload!\n");
 
@@ -1384,8 +1386,6 @@ void i915_driver_unload(struct drm_device *dev)
 
        intel_gvt_cleanup(dev_priv);
 
-       i915_driver_unregister(dev_priv);
-
        drm_vblank_cleanup(dev);
 
        intel_modeset_cleanup(dev);