diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2011-09-08 08:00:22 -0400 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-10-20 17:11:17 -0400 |
commit | 6fdd4d98e56e0919bb324c2ab1ff66395cf3b385 (patch) | |
tree | 7498b5861b425a724eee8afae0ad497582d33af8 /drivers/gpu | |
parent | a9e2641dee52cae2db7688a749344365642a5e79 (diff) |
drm/i915: properly cancel rps_work on module unload v2
The rps disabling code wasn't properly cancelling outstanding work
items. Also add a comment that explains why we're not racing with
the work item that could unmask interrupts - that piece of code
confused me quite a bit.
v2: Ben Widawsky pointed out that the first patch would deadlock
(and a few lesser problems). All corrected.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 5 |
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 7c8dfcc9be43..186cde29994d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -7658,6 +7658,10 @@ void gen6_disable_rps(struct drm_device *dev) | |||
7658 | I915_WRITE(GEN6_RPNSWREQ, 1 << 31); | 7658 | I915_WRITE(GEN6_RPNSWREQ, 1 << 31); |
7659 | I915_WRITE(GEN6_PMINTRMSK, 0xffffffff); | 7659 | I915_WRITE(GEN6_PMINTRMSK, 0xffffffff); |
7660 | I915_WRITE(GEN6_PMIER, 0); | 7660 | I915_WRITE(GEN6_PMIER, 0); |
7661 | /* Complete PM interrupt masking here doesn't race with the rps work | ||
7662 | * item again unmasking PM interrupts because that is using a different | ||
7663 | * register (PMIMR) to mask PM interrupts. The only risk is in leaving | ||
7664 | * stale bits in PMIIR and PMIMR which gen6_enable_rps will clean up. */ | ||
7661 | 7665 | ||
7662 | spin_lock_irq(&dev_priv->rps_lock); | 7666 | spin_lock_irq(&dev_priv->rps_lock); |
7663 | dev_priv->pm_iir = 0; | 7667 | dev_priv->pm_iir = 0; |
@@ -8655,6 +8659,7 @@ void intel_modeset_cleanup(struct drm_device *dev) | |||
8655 | * enqueue unpin/hotplug work. */ | 8659 | * enqueue unpin/hotplug work. */ |
8656 | drm_irq_uninstall(dev); | 8660 | drm_irq_uninstall(dev); |
8657 | cancel_work_sync(&dev_priv->hotplug_work); | 8661 | cancel_work_sync(&dev_priv->hotplug_work); |
8662 | cancel_work_sync(&dev_priv->rps_work); | ||
8658 | 8663 | ||
8659 | /* flush any delayed tasks or pending work */ | 8664 | /* flush any delayed tasks or pending work */ |
8660 | flush_scheduled_work(); | 8665 | flush_scheduled_work(); |