remarkable-linux/include/media
Hans Verkuil 5126f2590b [media] v4l2-dev: add flag to have the core lock all file operations
This used to be the default if the lock pointer was set, but now that lock is by
default only used for ioctl serialization. Those drivers that already used
core locking have this flag set explicitly, except for some drivers where
it was obvious that there was no need to serialize any file operations other
than ioctl.

The drivers that didn't need this flag were:

drivers/media/radio/dsbr100.c
drivers/media/radio/radio-isa.c
drivers/media/radio/radio-keene.c
drivers/media/radio/radio-miropcm20.c
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-tea5764.c
drivers/media/radio/radio-timb.c
drivers/media/video/vivi.c
sound/i2c/other/tea575x-tuner.c

The other drivers that use core locking and where it was not immediately
obvious that this flag wasn't needed were changed so that the flag is set
together with a comment that that driver needs work to avoid having to
set that flag. This will often involve taking the core lock in the fops
themselves.

Eventually this flag should go and it should not be used in new drivers.

There are a few reasons why we want to avoid core locking of non-ioctl
fops: in the case of mmap this can lead to a deadlock in rare situations
since when mmap is called the mmap_sem is held and it is possible for
other parts of the code to take that lock as well (copy_from_user()/copy_to_user()
perform a down_read(&mm->mmap_sem) when a page fault occurs).

It is very unlikely that that happens since the core lock serializes all
fops, but the kernel warns about it if lock validation is turned on.

For poll it is also undesirable to take the core lock as that can introduce
increased latency. The same is true for read/write.

While it was possible to make flags or something to turn on/off taking the
core lock for each file operation, in practice it is much simpler to just
not take it at all except for ioctl and leave it to the driver to take the
lock. There are only a handful fops compared to the zillion ioctls we have.

I also wanted to make it obvious which drivers still take the lock for all
fops, so that's why I chose to have drivers set it explicitly.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2012-05-14 09:19:38 -03:00
..
blackfin [media] add blackfin capture bridge driver 2012-03-19 15:08:20 -03:00
davinci [media] davinci: vpif: remove machine specific header file includes 2012-02-08 10:46:54 -02:00
adp1653.h
adv7183.h [media] adv7183: add adv7183 decoder driver 2012-03-19 15:04:10 -03:00
adv7343.h
ak881x.h
as3645a.h [media] as3645a: Add driver for LED flash controller 2011-12-20 09:36:18 -02:00
atmel-isi.h [media] atmel-isi: add code to enable/disable ISI_MCK clock 2012-01-06 11:01:11 -02:00
bt819.h
cs53l32a.h
cs5345.h
cx2341x.h
cx25840.h [media] cx25840: Add a flag to enable the CX23888 DIF to be enabled or not 2012-01-05 06:49:38 -02:00
gpio-ir-recv.h [media] gpio-ir-recv: a couple signedness bugs 2012-03-19 15:45:01 -03:00
i2c-addr.h
ir-kbd-i2c.h
lirc.h
lirc_dev.h
m5mols.h [media] m5mols: Remove superfluous irq field from the platform data struct 2011-09-24 00:23:03 -03:00
m52790.h
media-device.h device.h: audit and cleanup users in main include dir 2012-03-16 10:38:24 -04:00
media-devnode.h
media-entity.h [media] media: Add link_validate() op to check links to the sink pad 2012-05-14 08:44:11 -03:00
mmp-camera.h
msp3400.h
mt9m032.h [media] v4l: Add driver for Micron MT9M032 camera sensor 2012-03-19 18:56:33 -03:00
mt9p031.h [media] mt9p031: Aptina (Micron) MT9P031 5MP sensor driver 2011-09-11 09:49:28 -03:00
mt9t001.h [media] mt9t001: Aptina (Micron) MT9T001 3MP sensor driver 2011-09-21 15:31:08 -03:00
mt9t112.h
mt9v011.h
mt9v032.h
noon010pc30.h
omap1_camera.h
omap3isp.h [media] omap3isp: Add lane configuration to platform data 2012-05-14 08:50:23 -03:00
ov772x.h [media] V4L: ov772x: remove superfluous soc-camera client operations 2011-11-03 18:28:05 -02:00
ov7670.h
radio-si4713.h
rc-core.h [media] rc-core.h: Surround macro with do {} while (0) 2011-09-03 20:56:22 -03:00
rc-map.h [media] ati_remote: add support for Medion X10 Digitainer remote 2012-04-11 02:05:46 -03:00
rj54n1cb0c.h
s5k6aa.h [media] v4l: Add v4l2 subdev driver for S5K6AAFX sensor 2011-11-03 18:29:11 -02:00
s5p_fimc.h [media] s5p-fimc: Convert to use generic media bus polarity flags 2011-09-24 00:22:31 -03:00
s5p_hdmi.h [media] v4l: s5p-tv: hdmi: add support for platform data 2012-02-28 18:26:40 -03:00
saa6588.h
saa6752hs.h
saa7115.h
saa7127.h
saa7146.h Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
saa7146_vv.h
sh_mobile_ceu.h [media] V4L: sh_mobile_ceu_camera: maximum image size depends on the hardware version 2012-03-19 22:11:06 -03:00
sh_mobile_csi2.h [media] V4L: sh_mobile_csi2: switch away from using the soc-camera bus notifier 2011-07-27 17:56:08 -03:00
sh_vou.h
si4713.h
sii9234.h [media] v4l: s5p-tv: add sii9234 driver 2012-02-28 18:25:46 -03:00
smiapp.h [media] smiapp: Add driver 2012-05-14 09:06:00 -03:00
soc_camera.h [media] soc-camera: remove redundant parameter from .set_bus_param() 2012-01-06 11:00:23 -02:00
soc_camera_platform.h [media] V4L: soc_camera_platform: remove superfluous soc-camera client operations 2011-11-03 18:28:12 -02:00
soc_mediabus.h [media] V4L: soc-camera: add helper functions for new bus configuration type 2011-11-03 18:27:13 -02:00
sr030pc30.h
timb_radio.h
timb_video.h
tuner-types.h
tuner.h [media] tuner: add support for Xceive XC5000C 2012-02-14 17:20:46 -02:00
tvaudio.h
tveeprom.h
tvp514x.h
tvp5150.h
tvp7002.h
tw9910.h
upd64031a.h
upd64083.h
v4l2-chip-ident.h [media] vs6624: add vs6624 sensor driver 2012-03-19 15:04:26 -03:00
v4l2-common.h
v4l2-ctrls.h [media] v4l: Allow changing control handler lock 2012-05-14 08:46:27 -03:00
v4l2-dev.h [media] v4l2-dev: add flag to have the core lock all file operations 2012-05-14 09:19:38 -03:00
v4l2-device.h
v4l2-event.h [media] v4l2-event: Add v4l2_subscribed_event_ops 2012-05-07 16:28:35 -03:00
v4l2-fh.h
v4l2-int-device.h include: replace linux/module.h with "struct module" wherever possible 2011-10-31 19:32:32 -04:00
v4l2-ioctl.h The following text was taken from the original review request: 2012-03-24 10:41:37 -07:00
v4l2-mediabus.h [media] v4l2: Add polarity flag definitions for the parallel bus FIELD signal 2011-09-24 00:21:31 -03:00
v4l2-mem2mem.h
v4l2-subdev.h [media] v4l: Implement v4l2_subdev_link_validate() 2012-05-14 08:45:31 -03:00
videobuf-core.h
videobuf-dma-contig.h
videobuf-dma-sg.h doc: fix broken references 2011-09-27 18:08:04 +02:00
videobuf-dvb.h
videobuf-vmalloc.h
videobuf2-core.h [media] vb2: add vb2_get_unmapped_area in vb2 core 2011-11-03 18:29:13 -02:00
videobuf2-dma-contig.h [media] media: vb2: dma contig allocator: use dma_addr instread of paddr 2011-09-06 15:05:10 -03:00
videobuf2-dma-sg.h
videobuf2-memops.h
videobuf2-vmalloc.h
wm8775.h