drm/i915: Hold dev->event_lock whilst inspecting intel_crtc->unpin_work
authorChris Wilson <chris@chris-wilson.co.uk>
Sat, 10 Oct 2015 09:44:32 +0000 (10:44 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 13 Oct 2015 11:08:43 +0000 (13:08 +0200)
commit6042639c4c7f9e8a0c634245f034eb94827591a8
tree463da7e0403c102da2e1ec96e3e5b9aa86ea22b0
parent115719fceaa733d646e39cdce83cc32ddb891a49
drm/i915: Hold dev->event_lock whilst inspecting intel_crtc->unpin_work

We should serialise access to the intel_crtc->unpin_work through the
dev->event_lock spinlock. It should not be possible for it to disappear
without severe error as the mmio_flip worker has not tagged the
unpin_work pending flip-completion. Similarly if the error exists, just
taking the unpin_work whilst holding the spinlock and then using it
unserialised just masks the race. (It is supposed to be valid as the
unpin_work exists until the flip completion interrupt which should not
fire until we flush the mmio writes to update the display base which is
the last time we access the unpin_work from the kthread.)

References: https://bugs.freedesktop.org/show_bug.cgi?id=92335
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_display.c