linux/drivers/media/platform
Sylwester Nawrocki 740ad921f8 [media] s5p-fimc: Prevent AB-BA deadlock during links reconfiguration
This patch patch eliminates potential AB-BA deadlock when one process calls
open(), or VIDIOC_S/TRY_FMT ioctl  on the FIMC capture video node, while
other thread is reconfiguring media links via media device node:
/dev/video? open()		  /dev/media? MEDIA_IOC_SETUP_LINK ioctl
mutex_lock(video_lock)            mutex_lock(graph_lock)
    fimc_pipeline_open()               fimc_md_link_notify()
        mutex_lock(graph_lock)	          mutex_lock(video_lock)
          ...                               ...
The deadlock is avoided by always taking the graph mutex first in video
node open() or an ioctl, before the video lock is acquired. Reversed
order seems impossible, since media device driver's link_notify callback
is called with media graph mutex already held.
To ensure proper locking order VIDIOC_S_FMT and VIDIOC_TRY_FMT ioctls are
not serialized in the v4l2-core and the driver takes care of it itself.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2013-01-06 09:26:20 -02:00
..
blackfin [media] blackfin Kconfig: select is evil; use, instead depends on 2012-12-27 21:21:14 -02:00
davinci [media] davinci: vpbe: remove unused variable in vpbe_initialize() 2012-12-21 14:23:09 -02:00
exynos-gsc [media] exynos-gsc: modify number of output/capture buffers 2012-12-21 10:26:44 -02:00
marvell-ccic [media] marvell-ccic: use internal variable replace global frame stats variable 2012-12-27 18:04:22 -02:00
omap [media] omap: Fix Kconfig dependencies on OMAP2 2012-12-27 14:48:26 -02:00
omap3isp [media] omap3isp: ispqueue: Fix uninitialized variable compiler warnings 2012-12-27 18:21:49 -02:00
s3c-camif [media] s3c-camif: Add missing version.h header file 2012-12-27 20:26:06 -02:00
s5p-fimc [media] s5p-fimc: Prevent AB-BA deadlock during links reconfiguration 2013-01-06 09:26:20 -02:00
s5p-g2d
s5p-jpeg [media] s5p-jpeg: convert struct spinlock to spinlock_t 2012-12-27 14:59:44 -02:00
s5p-mfc Merge branch 'for_3.8-rc1' into v4l_for_linus 2012-12-11 11:28:37 -02:00
s5p-tv [media] s5p-tv: Use devm_gpio_request in sii9234_drv.c 2012-12-26 10:02:42 -02:00
soc_camera [media] mx2_camera: Convert it to platform driver 2013-01-05 01:52:06 -02:00
arv.c
coda.c [media] media: coda: Fix H.264 header alignment - v2 2012-12-21 16:56:31 -02:00
coda.h
fsl-viu.c [media] v4l: Convert drivers to use monotonic timestamps 2012-12-21 10:56:43 -02:00
indycam.c
indycam.h
Kconfig [media] media: add a VEU MEM2MEM format conversion and scaling driver 2012-12-20 14:23:10 -02:00
m2m-deinterlace.c [media] m2m-deinterlace: use correct check for kzalloc failure 2012-12-27 19:08:12 -02:00
Makefile [media] media: add a VEU MEM2MEM format conversion and scaling driver 2012-12-20 14:23:10 -02:00
mem2mem_testdev.c [media] v4l: mem2mem_testdev: add support for dmabuf importing 2012-11-25 17:19:45 -02:00
mx2_emmaprp.c Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2012-12-13 19:22:22 -08:00
omap24xxcam-dma.c
omap24xxcam.c [media] v4l: Convert drivers to use monotonic timestamps 2012-12-21 10:56:43 -02:00
omap24xxcam.h
sh_veu.c [media] sh_veu.c: fix two compilation warnings 2012-12-20 14:55:12 -02:00
sh_vou.c [media] v4l: Convert drivers to use monotonic timestamps 2012-12-21 10:56:43 -02:00
timblogiw.c [media] v4l: Convert drivers to use monotonic timestamps 2012-12-21 10:56:43 -02:00
via-camera.c
via-camera.h
vino.c [media] v4l: Tell user space we're using monotonic timestamps 2012-12-21 11:20:51 -02:00
vino.h
vivi.c [media] vivi: Constify structures 2012-12-28 13:32:51 -02:00