summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_display.c
diff options
context:
space:
mode:
authorDaniel Vetter2010-08-20 18:26:46 +0200
committerChris Wilson2010-09-08 11:13:24 +0200
commit6c0d93500eb50098e4e35b8b79e073f2f2f5b773 (patch)
treec6ef345799ac6ed7038686f3ba064042401f1566 /drivers/gpu/drm/i915/intel_display.c
parentdrm/i915: unload: fix error_work races (diff)
downloadkernel-qcow2-linux-6c0d93500eb50098e4e35b8b79e073f2f2f5b773.tar.gz
kernel-qcow2-linux-6c0d93500eb50098e4e35b8b79e073f2f2f5b773.tar.xz
kernel-qcow2-linux-6c0d93500eb50098e4e35b8b79e073f2f2f5b773.zip
drm/i915: unload: fix hotplug_work races
hotplug_work is queued by the hotplug interrupt and only either emits a hotplug uevent or queues a crt poll slow-work. No other locking. So it's safe to cancel this work _after_ irq's have been turned off. But before the modesetting objects are destroyed because the hotplug function accesses them (without locking). The current code (for kms) only switches irqs off after modesetting teardown, hence move the irq teardown into the modeset cleanup right before the crtc cleanup. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 7c9103030036..20be935830b0 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6073,6 +6073,11 @@ void intel_modeset_cleanup(struct drm_device *dev)
mutex_unlock(&dev->struct_mutex);
+ /* Disable the irq before mode object teardown, for the irq might
+ * enqueue unpin/hotplug work. */
+ drm_irq_uninstall(dev);
+ cancel_work_sync(&dev_priv->hotplug_work);
+
drm_mode_config_cleanup(dev);
}