Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: hold event_lock while accessing vblank_event_list

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>

authored by

Imre Deak and committed by
Inki Dae
e7783ba3 9fb7dff5

+3
+3
drivers/gpu/drm/drm_irq.c
··· 1021 1021 1022 1022 /* Send any queued vblank events, lest the natives grow disquiet */ 1023 1023 seq = drm_vblank_count_and_time(dev, crtc, &now); 1024 + 1025 + spin_lock(&dev->event_lock); 1024 1026 list_for_each_entry_safe(e, t, &dev->vblank_event_list, base.link) { 1025 1027 if (e->pipe != crtc) 1026 1028 continue; ··· 1033 1031 drm_vblank_put(dev, e->pipe); 1034 1032 send_vblank_event(dev, e, seq, &now); 1035 1033 } 1034 + spin_unlock(&dev->event_lock); 1036 1035 1037 1036 spin_unlock_irqrestore(&dev->vbl_lock, irqflags); 1038 1037 }