]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ENGR00227681 IPUv3:Use spinlock to protect buf ready reg
authorLiu Ying <Ying.Liu@freescale.com>
Wed, 10 Oct 2012 07:13:30 +0000 (15:13 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:32 +0000 (08:35 +0200)
commit83781ac4f5b5462ef079f037e6bb4c9e3206d0df
tree2cd7457696aecf2d22d0899848ebdefbfa3afaec
parentc0566de0a29e09d450b8232c483aea3fae82bd06
ENGR00227681 IPUv3:Use spinlock to protect buf ready reg

There are several channels' buffer ready bits controlled
by a single 32bit register-IPU_CHA_BUFx_RDY. These buffer
ready can be write-one-to-set or write-one-to-clear, which
is controlled by IPU_GPR register. v4l2 capture driver will
touch the buffer ready registers in interrupt context, so,
currently, ipu->mutex_lock is bypassed with the context.
Then, a race condition is that v4l2 capture driver interrupt
context tries to set a channel buffer ready, while, another
context tries to disable another channel(clear buffer ready
bit), which may cause v4l2 capture driver fails to set buffer
ready(SMFC0_FRM_LOST error may happen). This patch uses ipu->
rdy_reg_spin_lock to protect buffer ready registers to fix
the race condition issue and rename ipu->spin_lock to ipu->
int_reg_spin_lock.

Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
(cherry picked from commit d3515529a4be205809356961e58afa660781547b)
drivers/mxc/ipu3/ipu_capture.c
drivers/mxc/ipu3/ipu_common.c
drivers/mxc/ipu3/ipu_disp.c
drivers/mxc/ipu3/ipu_prv.h