linux/drivers/media
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
..
common [media] media: saa7146: don't use mutex_lock_interruptible() in device_release() 2012-12-27 17:34:28 -02:00
dvb-core [media] it913x: add support for Avermedia A835B 2012-12-27 19:13:30 -02:00
dvb-frontends [media] af9033: update fc2580 init sequence 2013-01-06 09:10:12 -02:00
firewire [media] remove include/linux/dvb/dmx.h 2012-10-19 07:29:17 -03:00
i2c [media] soc-camera: use devm_kzalloc in subdevice drivers 2013-01-05 01:45:31 -02:00
mmc [media] siano: fix RC compilation 2012-11-07 11:09:08 +01:00
parport [media] Add missing help for some menuconfig items 2012-08-21 08:17:37 -03:00
pci [media] ngene: fix commit 36a495a336 2013-01-05 02:06:58 -02:00
platform [media] s5p-fimc: Prevent AB-BA deadlock during links reconfiguration 2013-01-06 09:26:20 -02:00
radio [media] media: add driver for Masterkit MA901 usb radio 2012-12-28 12:20:33 -02:00
rc [media] media/rc: fix oops on unloading module rc-core 2012-12-27 17:45:40 -02:00
tuners [media] fc0012: remove unused callback and correct one comment 2013-01-06 09:09:06 -02:00
usb [media] af9035: print warning when firmware is bad 2013-01-06 09:10:34 -02:00
v4l2-core [media] v4l: Reset subdev v4l2_dev field to NULL if registration fails 2013-01-05 01:25:22 -02:00
Kconfig [media] Improve media Kconfig menu 2012-12-27 18:40:09 -02:00
Makefile [media] move i2c files into drivers/media/i2c 2012-09-06 18:42:54 -03:00
media-device.c [media] media: fix MEDIA_IOC_DEVICE_INFO return code 2012-08-12 07:57:57 -03:00
media-devnode.c [media] media-devnode: Replace printk with pr_* 2012-09-27 14:19:23 -03:00
media-entity.c