]> git.baikalelectronics.ru Git - kernel.git/commit
drm/shmobile: Fix race condition between page flip request and handler
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tue, 12 Mar 2013 14:38:43 +0000 (15:38 +0100)
committerDave Airlie <airlied@redhat.com>
Fri, 26 Apr 2013 00:21:57 +0000 (10:21 +1000)
commitd12e22d4aa3af0f1a48c2c8227f3227e60648ec3
tree9f8b91f9950085758565c499b8eec33ec21958c0
parent495c3d7a11d78248c19f7292f6421459c9cb901b
drm/shmobile: Fix race condition between page flip request and handler

The page flip handler stores the page flip event pointer and then calls
drm_vblank_get() to enable the vblank interrupt. Due to the vblank off
delay, the vblank interrupt can be enabled in the hardware at that
point, even if the vblank reference count is equal to 0. If a vblank
interrupt is triggered between storing the event pointer and calling
drm_vblank_get(), the page flip completion handler will process the
event and call drm_vblank_put() with a reference count equal to 0. This
will result in a BUG_ON.

Fix the race condition by calling drm_vblank_get() before storing the
event pointer.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/shmobile/shmob_drm_crtc.c