ENGR00229855 mx6sl: csi: can not support two camera instances
run two unit test instances as follows fails (sometimes kernel dump).
/unit_tests/csi_v4l2_capture.out &
/unit_tests/csi_v4l2_capture.out
Fix by improving the resource lock.
- We get busy_lock semaphore before we get a dqueue event, so, when user
is blocked at DQBUF ioctrl, the user will also be blocked at QBUF ioctrl,
then the video performance will drop. This patch changes to get busy_lock
semaphore to protect DQBUF ioctrl until we successfully get a dqueue event.
- Use queue_int_lock spinlock to protect cam->ping_pong_csi, since it can be
modified either in irq handler or in queue event.
- linked list should be protected by the lock:
-- Use queue_int_lock and dqueue_int_lock spinlocks to protect working_q/
ready_q/done_q in the end of frame interrupt handler camera_callback(),
in case, the handler and VIDIOC_QBUF/VIDIOC_DQBUF ioctrls are called on
different threads at same time.
-- Protect ready_q with queue_int_lock spinlock in streamon(), in case,
VIDIOC_STREAMON and VIDIOC_QBUF ioctrls are called on different threads
at same time.