]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00229855 mx6sl: csi: can not support two camera instances
authorRobby Cai <R63905@freescale.com>
Thu, 29 Nov 2012 09:58:43 +0000 (17:58 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:48 +0000 (08:35 +0200)
commit410f4716ea61c91b5731d2e18b4830f22585f8e8
tree0d1c4727b3dc7c60f1bcff7204f5124067492134
parent7d1a87d39a9d2fa3e5752840e42f4f8ad27712ba
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.

Signed-off-by: Robby Cai <R63905@freescale.com>
drivers/media/video/mxc/capture/csi_v4l2_capture.c
drivers/media/video/mxc/capture/fsl_csi.c