drm/i915: unload: fix idle_timer/idle_work races
commit3dec0095f71e7d00b7f6180229fd32a2d0a6ce8d
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 20 Aug 2010 19:40:52 +0000 (20 21:40 +0200)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Sep 2010 09:13:26 +0000 (8 10:13 +0100)
tree77dc949a759d2016c33940d0c5f75e99826fd8ca
parenta8b4899e4658e53c0c8f4206af105e358e39ee93
drm/i915: unload: fix idle_timer/idle_work races

idle_work wasn't cleaned up at all. It takes &dev->struct_mutex, but
accesss the mode_config crtc list (without any other locking!). Hence
this work needs to be canceled before calling drm_mode_config_cleanup.

As evidenced by the kernel's object debuggin code, the current code
also cleans up the timer to early (it gets rearmed). So move it right
before the final cleanup (it seems to work).

Also unconditionally set up the idle_timer in intel_increase_pllclock.
If we're unlucky the timer might fire right away, rendering the call
in the modesetting teardown pointless.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/intel_display.c