]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vkms: Fix race condition around accessing frame number
authorHaneen Mohammed <hamohammed.sa@gmail.com>
Mon, 3 Sep 2018 21:18:17 +0000 (00:18 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 5 Sep 2018 14:04:50 +0000 (16:04 +0200)
commit0d70ffe7dbd53f5d0a73787c385c7300d8578d97
treee487af079a4fd29add813e801f9afcc3f0f2d37f
parent942a3537e79b3c2f1e44ec2b93496364802fb2e5
drm/vkms: Fix race condition around accessing frame number

crtc_state is accessed by both vblank_handle() and the ordered
work_struct handle vkms_crc_work_handle() to retrieve and or update
the frame number for computed CRC.

Since work_struct can fail, add frame_end to account for missing frame
numbers.

Use (frame_[start/end]) for synchronization between hrtimer callback
and ordered work_struct handle.

This patch passes the following subtests from igt kms_pipe_crc_basic test:
bad-source, read-crc-pipe-A, read-crc-pipe-A-frame-sequence,
nonblocking-crc-pipe-A, nonblocking-crc-pipe-A-frame-sequence

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180903211743.GA2773@haneenDRM
drivers/gpu/drm/vkms/vkms_crc.c
drivers/gpu/drm/vkms/vkms_crtc.c
drivers/gpu/drm/vkms/vkms_drv.h