linux/drivers/media/video/davinci
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
..
ccdc_hw_device.h
dm355_ccdc_regs.h
dm355_ccdc.c [media] [trivial] davinci: Fix typo in dm355_ccdvc.c 2012-03-08 11:09:29 -03:00
dm644x_ccdc_regs.h V4L/DVB: V4L: dm644x_ccdc: Add Suspend/Resume Support 2010-05-18 00:52:45 -03:00
dm644x_ccdc.c [media] convert drivers/media/* to use module_platform_driver() 2012-01-10 23:27:13 -02:00
isif_regs.h V4L/DVB: Fix bad whitespacing 2010-05-18 00:47:01 -03:00
isif.c [media] media: davinci: added module.h to resolve unresolved macros 2012-02-28 17:06:54 -03:00
Kconfig [media] davinci vpbe: Build infrastructure for VPBE driver 2011-07-27 17:53:10 -03:00
Makefile [media] davinci vpbe: Build infrastructure for VPBE driver 2011-07-27 17:53:10 -03:00
vpbe_display.c [media] v4l2-dev: add flag to have the core lock all file operations 2012-05-14 09:19:38 -03:00
vpbe_osd_regs.h [media] davinci vpbe: OSD(On Screen Display) block 2011-07-27 17:53:10 -03:00
vpbe_osd.c [media] davinci: remove includes of mach/io.h 2012-03-06 21:34:39 -06:00
vpbe_venc_regs.h [media] davinci vpbe: VENC( Video Encoder) implementation 2011-07-27 17:53:10 -03:00
vpbe_venc.c [media] davinci: remove includes of mach/io.h 2012-03-06 21:34:39 -06:00
vpbe.c [media] convert drivers/media/* to use module_platform_driver() 2012-01-10 23:27:13 -02:00
vpfe_capture.c [media] V4L2: drivers implementing vidioc_default should also return -ENOTTY 2012-04-19 17:23:55 -03:00
vpif_capture.c [media] v4l2-dev: add flag to have the core lock all file operations 2012-05-14 09:19:38 -03:00
vpif_capture.h ARM: davinci: vpif: move code to driver core header from platform 2011-12-03 00:33:50 +05:30
vpif_display.c [media] v4l2-dev: add flag to have the core lock all file operations 2012-05-14 09:19:38 -03:00
vpif_display.h ARM: davinci: vpif: move code to driver core header from platform 2011-12-03 00:33:50 +05:30
vpif.c treewide: Convert uses of struct resource to resource_size(ptr) 2011-06-10 14:55:36 +02:00
vpif.h [media] davinci: vpif: remove machine specific header file includes 2012-02-08 10:46:54 -02:00
vpss.c tree-wide: fix comment/printk typos 2010-11-01 15:38:34 -04:00