Skip to content

Commit

Permalink
drm: hold event_lock while accessing vblank_event_list
Browse files Browse the repository at this point in the history
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.deak@intel.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Imre Deak authored and Inki Dae committed Nov 29, 2012
1 parent 9fb7dff commit e7783ba
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,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;
Expand All @@ -1031,6 +1033,7 @@ void drm_vblank_off(struct drm_device *dev, int crtc)
drm_vblank_put(dev, e->pipe);
send_vblank_event(dev, e, seq, &now);
}
spin_unlock(&dev->event_lock);

spin_unlock_irqrestore(&dev->vbl_lock, irqflags);
}
Expand Down

0 comments on commit e7783ba

Please sign in to comment.