diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2010-08-20 12:26:46 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-09-08 05:13:24 -0400 |
commit | 6c0d93500eb50098e4e35b8b79e073f2f2f5b773 (patch) | |
tree | c6ef345799ac6ed7038686f3ba064042401f1566 /drivers | |
parent | bc0c7f14432f7f94b16f972f2d23b8c1248249b4 (diff) |
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')
-rw-r--r-- | drivers/gpu/drm/i915/i915_dma.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 736cca8a03d4..45236e716669 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -2275,7 +2275,7 @@ int i915_driver_unload(struct drm_device *dev) | |||
2275 | dev_priv->child_dev = NULL; | 2275 | dev_priv->child_dev = NULL; |
2276 | dev_priv->child_dev_num = 0; | 2276 | dev_priv->child_dev_num = 0; |
2277 | } | 2277 | } |
2278 | drm_irq_uninstall(dev); | 2278 | |
2279 | vga_switcheroo_unregister_client(dev->pdev); | 2279 | vga_switcheroo_unregister_client(dev->pdev); |
2280 | vga_client_register(dev->pdev, NULL, NULL, NULL); | 2280 | vga_client_register(dev->pdev, NULL, NULL, NULL); |
2281 | } | 2281 | } |
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) | |||
6073 | 6073 | ||
6074 | mutex_unlock(&dev->struct_mutex); | 6074 | mutex_unlock(&dev->struct_mutex); |
6075 | 6075 | ||
6076 | /* Disable the irq before mode object teardown, for the irq might | ||
6077 | * enqueue unpin/hotplug work. */ | ||
6078 | drm_irq_uninstall(dev); | ||
6079 | cancel_work_sync(&dev_priv->hotplug_work); | ||
6080 | |||
6076 | drm_mode_config_cleanup(dev); | 6081 | drm_mode_config_cleanup(dev); |
6077 | } | 6082 | } |
6078 | 6083 | ||