drm/exynos: hold event_lock while accessing pageflip_event_list
authorImre Deak <imre.deak@intel.com>
Fri, 2 Nov 2012 11:30:47 +0000 (13:30 +0200)
committerInki Dae <daeinki@gmail.com>
Thu, 29 Nov 2012 11:30:33 +0000 (03:30 -0800)
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>
drivers/gpu/drm/exynos/exynos_drm_crtc.c

index fce245f64c4f6729404a9f22772ea334e7edd3a8..2efa4b031d7340d075e86f9f4136d7f8d2a2a40c 100644 (file)
@@ -236,16 +236,21 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
                        goto out;
                }
 
+               spin_lock_irq(&dev->event_lock);
                list_add_tail(&event->base.link,
                                &dev_priv->pageflip_event_list);
+               spin_unlock_irq(&dev->event_lock);
 
                crtc->fb = fb;
                ret = exynos_drm_crtc_mode_set_base(crtc, crtc->x, crtc->y,
                                                    NULL);
                if (ret) {
                        crtc->fb = old_fb;
+
+                       spin_lock_irq(&dev->event_lock);
                        drm_vblank_put(dev, exynos_crtc->pipe);
                        list_del(&event->base.link);
+                       spin_unlock_irq(&dev->event_lock);
 
                        goto out;
                }