Currently the only users of drm_vblank_off() are i915 and gma500,
neither of which holds the event_lock when calling this function.
Fix this by holding the event_lock while traversing the list.

Signed-off-by: Imre Deak <imre.d...@intel.com>
---
 drivers/gpu/drm/drm_irq.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c
index 3a3d0ce..c6cd558 100644
--- a/drivers/gpu/drm/drm_irq.c
+++ b/drivers/gpu/drm/drm_irq.c
@@ -949,6 +949,8 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
 
        /* Send any queued vblank events, lest the natives grow disquiet */
        seq = drm_vblank_count_and_time(dev, crtc, &now);
+
+       spin_lock(&dev->event_lock);
        list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) {
                if (e->pipe != crtc)
                        continue;
@@ -965,6 +967,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
                trace_drm_vblank_event_delivered(e->base.pid, e->pipe,
                                                 e->event.sequence);
        }
+       spin_unlock(&dev->event_lock);
 
        spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
 }
-- 
1.7.9.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Reply via email to