linux_dsm_epyc7002/drivers/media/video/ivtv
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
..
ivtv-cards.c [media] ivtv: Add Adaptec Remote Controller 2010-12-30 12:17:08 -02:00
ivtv-cards.h [media] ivtv: Add Adaptec Remote Controller 2010-12-30 12:17:08 -02:00
ivtv-controls.c [media] ivtv: simplify how the decoder controls are set up 2012-03-08 11:03:51 -03:00
ivtv-controls.h [media] ivtv: implement new decoder controls 2012-02-14 13:44:41 -02:00
ivtv-driver.c [media] ivtv: set max/step to 0 for PTS and FRAME controls 2012-05-04 15:06:19 -03:00
ivtv-driver.h Disintegrate and delete asm/system.h 2012-03-28 15:58:21 -07:00
ivtv-fileops.c [media] ivtv: only start streaming in poll() if polling for input 2012-03-27 11:36:29 -03:00
ivtv-fileops.h
ivtv-firmware.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-firmware.h V4L/DVB: ivtv: Add firmare monitoring and debug mode to ignore firmware problems 2010-08-02 14:47:55 -03:00
ivtv-gpio.c V4L/DVB: ivtv: convert gpio subdev to new control framework 2010-08-08 23:43:05 -03:00
ivtv-gpio.h
ivtv-i2c.c [media] rc/keymaps: Remove the obsolete rc-rc5-tv keymap 2011-03-22 19:24:17 -03:00
ivtv-i2c.h [media] video: Drop undue references to i2c-algo-bit 2011-11-24 15:11:17 -02:00
ivtv-ioctl.c [media] v4l2-ctrls: Use v4l2_subscribed_event_ops 2012-05-07 16:29:35 -03:00
ivtv-ioctl.h [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-irq.c [media] ivtv: remove open_id/id from the filehandle code 2012-01-16 10:00:10 -02:00
ivtv-irq.h ivtv: use kthread_worker instead of workqueue 2010-06-29 10:07:09 +02:00
ivtv-mailbox.c V4L/DVB: ivtv: Automatic firmware reload 2010-08-02 14:48:13 -03:00
ivtv-mailbox.h V4L/DVB: ivtv: Automatic firmware reload 2010-08-02 14:48:13 -03:00
ivtv-queue.c
ivtv-queue.h
ivtv-routing.c
ivtv-routing.h
ivtv-streams.c [media] v4l2-dev: add flag to have the core lock all file operations 2012-05-14 09:19:38 -03:00
ivtv-streams.h
ivtv-udma.c media: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:18 +08:00
ivtv-udma.h
ivtv-vbi.c [media] ivtv: Internally separate encoder & decoder standard setting 2011-06-01 08:46:38 -03:00
ivtv-vbi.h [media] ivtv: Return EFAULT when copy_from_user() fails in ivtv_write_vbi_from_user() 2010-12-29 08:17:10 -02:00
ivtv-version.h [media] ivtv,cx18: Use default version control for VIDIOC_QUERYCAP 2011-07-27 17:53:14 -03:00
ivtv-yuv.c [media] ivtv: switch to the v4l core lock 2012-01-16 09:59:43 -02:00
ivtv-yuv.h
ivtvfb.c Driver core: driver_find() drops reference before returning 2012-01-24 16:00:34 -08:00
Kconfig [media] rc: rename the remaining things to rc_core 2010-12-29 08:16:50 -02:00
Makefile [media] media: ivtv: append $(srctree) to -I parameters 2012-03-08 10:42:03 -03:00