* [PATCH 0/5] Pushdown bkl from v4l ioctls
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
@ 2010-04-29 3:42 ` Frederic Weisbecker
2010-04-29 6:44 ` Hans Verkuil
2010-04-29 3:42 ` [PATCH 1/5] v4l: Pushdown bkl into video_ioctl2 Frederic Weisbecker
` (3 subsequent siblings)
4 siblings, 1 reply; 12+ messages in thread
From: Frederic Weisbecker @ 2010-04-29 3:42 UTC (permalink / raw)
To: LKML
Cc: LKML, Frederic Weisbecker, Laurent Pinchart, Hans Verkuil,
Arnd Bergmann, John Kacur, Linus Torvalds, Jan Blunck,
Thomas Gleixner, Mauro Carvalho Chehab, Greg KH,
Linux Media Mailing List
Hi,
Linus suggested to rename struct v4l2_file_operations::ioctl
into bkl_ioctl to eventually get something greppable and make
its background explicit.
While at it I thought it could be a good idea to just pushdown
the bkl to every v4l drivers that have an .ioctl, so that we
actually remove struct v4l2_file_operations::ioctl for good.
It passed make allyesconfig on sparc.
Please tell me what you think.
Thanks.
Frederic Weisbecker (5):
v4l: Pushdown bkl into video_ioctl2
v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl
v4l: Change users of video_ioctl2 to use unlocked_ioctl
v4l: Pushdown bkl to drivers that implement their own ioctl
v4l: Remove struct v4l2_file_operations::ioctl
drivers/media/common/saa7146_fops.c | 2 +-
drivers/media/radio/dsbr100.c | 2 +-
drivers/media/radio/radio-aimslab.c | 2 +-
drivers/media/radio/radio-aztech.c | 2 +-
drivers/media/radio/radio-cadet.c | 2 +-
drivers/media/radio/radio-gemtek-pci.c | 2 +-
drivers/media/radio/radio-gemtek.c | 2 +-
drivers/media/radio/radio-maestro.c | 2 +-
drivers/media/radio/radio-maxiradio.c | 2 +-
drivers/media/radio/radio-miropcm20.c | 2 +-
drivers/media/radio/radio-mr800.c | 2 +-
drivers/media/radio/radio-rtrack2.c | 2 +-
drivers/media/radio/radio-sf16fmi.c | 2 +-
drivers/media/radio/radio-sf16fmr2.c | 2 +-
drivers/media/radio/radio-si4713.c | 2 +-
drivers/media/radio/radio-tea5764.c | 2 +-
drivers/media/radio/radio-terratec.c | 2 +-
drivers/media/radio/radio-timb.c | 2 +-
drivers/media/radio/radio-trust.c | 2 +-
drivers/media/radio/radio-typhoon.c | 2 +-
drivers/media/radio/radio-zoltrix.c | 2 +-
drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
drivers/media/video/arv.c | 2 +-
drivers/media/video/au0828/au0828-video.c | 14 ++++----
drivers/media/video/bt8xx/bttv-driver.c | 26 +++++++-------
drivers/media/video/bw-qcam.c | 11 +++++-
drivers/media/video/c-qcam.c | 11 +++++-
drivers/media/video/cafe_ccic.c | 14 ++++----
drivers/media/video/cpia.c | 11 +++++-
drivers/media/video/cpia2/cpia2_v4l.c | 11 +++++-
drivers/media/video/cx18/cx18-streams.c | 12 +++---
drivers/media/video/cx231xx/cx231xx-video.c | 4 +-
drivers/media/video/cx23885/cx23885-417.c | 2 +-
drivers/media/video/cx23885/cx23885-video.c | 4 +-
drivers/media/video/cx88/cx88-blackbird.c | 2 +-
drivers/media/video/cx88/cx88-video.c | 4 +-
drivers/media/video/davinci/vpfe_capture.c | 2 +-
drivers/media/video/davinci/vpif_capture.c | 2 +-
drivers/media/video/davinci/vpif_display.c | 2 +-
drivers/media/video/em28xx/em28xx-video.c | 4 +-
drivers/media/video/et61x251/et61x251_core.c | 27 +++++++++++----
drivers/media/video/gspca/gspca.c | 2 +-
drivers/media/video/hdpvr/hdpvr-video.c | 2 +-
drivers/media/video/meye.c | 2 +-
drivers/media/video/omap24xxcam.c | 10 +++---
drivers/media/video/ov511.c | 15 +++++---
drivers/media/video/pms.c | 2 +-
drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 20 +++++++----
drivers/media/video/pwc/pwc-if.c | 19 ++++++----
drivers/media/video/s2255drv.c | 12 +++---
drivers/media/video/saa5246a.c | 11 ++++--
drivers/media/video/saa5249.c | 6 +++-
drivers/media/video/saa7134/saa7134-empress.c | 14 ++++----
drivers/media/video/saa7134/saa7134-video.c | 26 +++++++-------
drivers/media/video/se401.c | 20 +++++++----
drivers/media/video/sn9c102/sn9c102_core.c | 27 +++++++++++----
drivers/media/video/soc_camera.c | 2 +-
drivers/media/video/stk-webcam.c | 14 ++++----
drivers/media/video/stradis.c | 26 +++++++++++----
drivers/media/video/stv680.c | 20 +++++++----
drivers/media/video/tlg2300/pd-radio.c | 8 ++--
drivers/media/video/tlg2300/pd-video.c | 2 +-
drivers/media/video/usbvideo/usbvideo.c | 21 ++++++++----
drivers/media/video/usbvideo/vicam.c | 14 +++++++-
drivers/media/video/usbvision/usbvision-video.c | 4 +-
drivers/media/video/uvc/uvc_v4l2.c | 11 +++++-
drivers/media/video/v4l2-dev.c | 38 ++-------------------
drivers/media/video/v4l2-ioctl.c | 17 ++++++++-
drivers/media/video/vivi.c | 2 +-
drivers/media/video/w9966.c | 2 +-
drivers/media/video/w9968cf.c | 25 +++++++++++---
drivers/media/video/zc0301/zc0301_core.c | 27 +++++++++++----
drivers/media/video/zoran/zoran_driver.c | 16 ++++----
drivers/media/video/zr364xx.c | 14 ++++----
drivers/staging/cx25821/cx25821-audups11.c | 18 ++++++----
drivers/staging/cx25821/cx25821-video0.c | 14 ++++----
drivers/staging/cx25821/cx25821-video1.c | 14 ++++----
drivers/staging/cx25821/cx25821-video2.c | 14 ++++----
drivers/staging/cx25821/cx25821-video3.c | 14 ++++----
drivers/staging/cx25821/cx25821-video4.c | 14 ++++----
drivers/staging/cx25821/cx25821-video5.c | 14 ++++----
drivers/staging/cx25821/cx25821-video6.c | 14 ++++----
drivers/staging/cx25821/cx25821-video7.c | 14 ++++----
drivers/staging/cx25821/cx25821-videoioctl.c | 27 +++++++++++----
drivers/staging/cx25821/cx25821-vidups10.c | 19 +++++++----
drivers/staging/cx25821/cx25821-vidups9.c | 18 ++++++----
drivers/staging/dream/camera/msm_v4l2.c | 27 +++++++++++----
drivers/staging/go7007/go7007-v4l2.c | 2 +-
drivers/staging/tm6000/tm6000-video.c | 2 +-
include/media/v4l2-dev.h | 1 -
include/media/v4l2-ioctl.h | 2 +
sound/i2c/other/tea575x-tuner.c | 2 +-
92 files changed, 530 insertions(+), 360 deletions(-)
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/5] v4l: Pushdown bkl into video_ioctl2
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
2010-04-29 3:42 ` [PATCH 0/5] Pushdown bkl from v4l ioctls Frederic Weisbecker
@ 2010-04-29 3:42 ` Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 2/5] v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl Frederic Weisbecker
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Frederic Weisbecker @ 2010-04-29 3:42 UTC (permalink / raw)
To: LKML
Cc: LKML, Frederic Weisbecker, Laurent Pinchart, Hans Verkuil,
Arnd Bergmann, John Kacur, Linus Torvalds, Jan Blunck,
Thomas Gleixner, Mauro Carvalho Chehab, Linux Media Mailing List
video_ioctl2 is a generic ioctl helper used by a lot of drivers.
Most of them put it as their bkl'ed .ioctl callback, then let's
pushdown the bkl inside but also provide an unlocked version for
those that use it as an unlocked ioctl.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
drivers/media/video/v4l2-ioctl.c | 17 +++++++++++++++--
include/media/v4l2-ioctl.h | 2 ++
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 3da8d8f..0ff2595 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -16,6 +16,7 @@
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
+#include <linux/smp_lock.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls */
#include <linux/videodev.h>
@@ -2007,8 +2008,8 @@ static unsigned long cmd_input_size(unsigned int cmd)
}
}
-long video_ioctl2(struct file *file,
- unsigned int cmd, unsigned long arg)
+long video_ioctl2_unlocked(struct file *file,
+ unsigned int cmd, unsigned long arg)
{
char sbuf[128];
void *mbuf = NULL;
@@ -2102,4 +2103,16 @@ out:
kfree(mbuf);
return err;
}
+EXPORT_SYMBOL(video_ioctl2_unlocked);
+
+long video_ioctl2(struct file *file, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = video_ioctl2_unlocked(file, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
EXPORT_SYMBOL(video_ioctl2);
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h
index e8ba0f2..08b3e42 100644
--- a/include/media/v4l2-ioctl.h
+++ b/include/media/v4l2-ioctl.h
@@ -316,5 +316,7 @@ extern long video_usercopy(struct file *file, unsigned int cmd,
/* Standard handlers for V4L ioctl's */
extern long video_ioctl2(struct file *file,
unsigned int cmd, unsigned long arg);
+extern long video_ioctl2_unlocked(struct file *file,
+ unsigned int cmd, unsigned long arg);
#endif /* _V4L2_IOCTL_H */
--
1.6.2.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 2/5] v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
2010-04-29 3:42 ` [PATCH 0/5] Pushdown bkl from v4l ioctls Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 1/5] v4l: Pushdown bkl into video_ioctl2 Frederic Weisbecker
@ 2010-04-29 3:42 ` Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 3/5] v4l: Change users of video_ioctl2 to use unlocked_ioctl Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 4/5] v4l: Pushdown bkl to drivers that implement their own ioctl Frederic Weisbecker
4 siblings, 0 replies; 12+ messages in thread
From: Frederic Weisbecker @ 2010-04-29 3:42 UTC (permalink / raw)
To: LKML
Cc: LKML, Frederic Weisbecker, Laurent Pinchart, Hans Verkuil,
Arnd Bergmann, John Kacur, Linus Torvalds, Jan Blunck,
Thomas Gleixner, Mauro Carvalho Chehab, Linux Media Mailing List
There are three drivers that use video_ioctl2() as an unlocked_ioctl,
let them use the new video_ioctl2_unlocked.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
drivers/media/video/davinci/vpfe_capture.c | 2 +-
drivers/media/video/gspca/gspca.c | 2 +-
drivers/media/video/hdpvr/hdpvr-video.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
index aa1411f..61a3514 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -786,7 +786,7 @@ static const struct v4l2_file_operations vpfe_fops = {
.owner = THIS_MODULE,
.open = vpfe_open,
.release = vpfe_release,
- .unlocked_ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2_unlocked,
.mmap = vpfe_mmap,
.poll = vpfe_poll
};
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 68a8431..a424c1d 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -2184,7 +2184,7 @@ static struct v4l2_file_operations dev_fops = {
.release = dev_close,
.read = dev_read,
.mmap = dev_mmap,
- .unlocked_ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2_unlocked,
.poll = dev_poll,
};
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index 196f82d..01b8a34 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -559,7 +559,7 @@ static const struct v4l2_file_operations hdpvr_fops = {
.release = hdpvr_release,
.read = hdpvr_read,
.poll = hdpvr_poll,
- .unlocked_ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2_unlocked,
};
/*=======================================================================*/
--
1.6.2.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/5] v4l: Change users of video_ioctl2 to use unlocked_ioctl
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
` (2 preceding siblings ...)
2010-04-29 3:42 ` [PATCH 2/5] v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl Frederic Weisbecker
@ 2010-04-29 3:42 ` Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 4/5] v4l: Pushdown bkl to drivers that implement their own ioctl Frederic Weisbecker
4 siblings, 0 replies; 12+ messages in thread
From: Frederic Weisbecker @ 2010-04-29 3:42 UTC (permalink / raw)
To: LKML
Cc: LKML, Frederic Weisbecker, Laurent Pinchart, Hans Verkuil,
Arnd Bergmann, John Kacur, Linus Torvalds, Jan Blunck,
Thomas Gleixner, Mauro Carvalho Chehab, Linux Media Mailing List
Now that video_ioctl2() got the bkl pushed down, update its users
to use .unlocked_ioctl instead of ioctl.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
drivers/media/common/saa7146_fops.c | 2 +-
drivers/media/radio/dsbr100.c | 2 +-
drivers/media/radio/radio-aimslab.c | 2 +-
drivers/media/radio/radio-aztech.c | 2 +-
drivers/media/radio/radio-cadet.c | 2 +-
drivers/media/radio/radio-gemtek-pci.c | 2 +-
drivers/media/radio/radio-gemtek.c | 2 +-
drivers/media/radio/radio-maestro.c | 2 +-
drivers/media/radio/radio-maxiradio.c | 2 +-
drivers/media/radio/radio-miropcm20.c | 2 +-
drivers/media/radio/radio-mr800.c | 2 +-
drivers/media/radio/radio-rtrack2.c | 2 +-
drivers/media/radio/radio-sf16fmi.c | 2 +-
drivers/media/radio/radio-sf16fmr2.c | 2 +-
drivers/media/radio/radio-si4713.c | 2 +-
drivers/media/radio/radio-tea5764.c | 2 +-
drivers/media/radio/radio-terratec.c | 2 +-
drivers/media/radio/radio-timb.c | 2 +-
drivers/media/radio/radio-trust.c | 2 +-
drivers/media/radio/radio-typhoon.c | 2 +-
drivers/media/radio/radio-zoltrix.c | 2 +-
drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
drivers/media/video/arv.c | 2 +-
drivers/media/video/au0828/au0828-video.c | 14 ++++++------
drivers/media/video/bt8xx/bttv-driver.c | 26 +++++++++++-----------
drivers/media/video/cafe_ccic.c | 14 ++++++------
drivers/media/video/cx18/cx18-streams.c | 12 +++++-----
drivers/media/video/cx231xx/cx231xx-video.c | 4 +-
drivers/media/video/cx23885/cx23885-417.c | 2 +-
drivers/media/video/cx23885/cx23885-video.c | 4 +-
drivers/media/video/cx88/cx88-blackbird.c | 2 +-
drivers/media/video/cx88/cx88-video.c | 4 +-
drivers/media/video/davinci/vpif_capture.c | 2 +-
drivers/media/video/davinci/vpif_display.c | 2 +-
drivers/media/video/em28xx/em28xx-video.c | 4 +-
drivers/media/video/meye.c | 2 +-
drivers/media/video/omap24xxcam.c | 10 ++++----
drivers/media/video/pms.c | 2 +-
drivers/media/video/s2255drv.c | 12 +++++-----
drivers/media/video/saa7134/saa7134-empress.c | 14 ++++++------
drivers/media/video/saa7134/saa7134-video.c | 26 +++++++++++-----------
drivers/media/video/soc_camera.c | 2 +-
drivers/media/video/stk-webcam.c | 14 ++++++------
drivers/media/video/tlg2300/pd-radio.c | 8 +++---
drivers/media/video/tlg2300/pd-video.c | 2 +-
drivers/media/video/usbvision/usbvision-video.c | 4 +-
drivers/media/video/w9966.c | 2 +-
drivers/media/video/zoran/zoran_driver.c | 16 ++++++------
drivers/media/video/zr364xx.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video0.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video1.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video2.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video3.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video4.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video5.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video6.c | 14 ++++++------
drivers/staging/cx25821/cx25821-video7.c | 14 ++++++------
drivers/staging/go7007/go7007-v4l2.c | 2 +-
drivers/staging/tm6000/tm6000-video.c | 2 +-
sound/i2c/other/tea575x-tuner.c | 2 +-
60 files changed, 191 insertions(+), 191 deletions(-)
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c
index fd8e1f4..2e76112 100644
--- a/drivers/media/common/saa7146_fops.c
+++ b/drivers/media/common/saa7146_fops.c
@@ -396,7 +396,7 @@ static const struct v4l2_file_operations video_fops =
.write = fops_write,
.poll = fops_poll,
.mmap = fops_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static void vv_callback(struct saa7146_dev *dev, unsigned long status)
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index ed9cd7a..c3e952f 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -605,7 +605,7 @@ static void usb_dsbr100_video_device_release(struct video_device *videodev)
/* File system interface */
static const struct v4l2_file_operations usb_dsbr100_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops usb_dsbr100_ioctl_ops = {
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
index 5bf4985..39a647e 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -361,7 +361,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations rtrack_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops rtrack_ioctl_ops = {
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c
index c223113..53d48bb 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -324,7 +324,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
static const struct v4l2_file_operations aztech_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops aztech_ioctl_ops = {
diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c
index 482d0f3..bf1656e 100644
--- a/drivers/media/radio/radio-cadet.c
+++ b/drivers/media/radio/radio-cadet.c
@@ -558,7 +558,7 @@ static const struct v4l2_file_operations cadet_fops = {
.open = cadet_open,
.release = cadet_release,
.read = cadet_read,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.poll = cadet_poll,
};
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index 7903967..7ab33e0 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -361,7 +361,7 @@ MODULE_DEVICE_TABLE(pci, gemtek_pci_id);
static const struct v4l2_file_operations gemtek_pci_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = {
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 73985f6..43d5466 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -378,7 +378,7 @@ static int gemtek_probe(struct gemtek *gt)
static const struct v4l2_file_operations gemtek_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static int vidioc_querycap(struct file *file, void *priv,
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c
index 08f1051..0ad65ef 100644
--- a/drivers/media/radio/radio-maestro.c
+++ b/drivers/media/radio/radio-maestro.c
@@ -299,7 +299,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations maestro_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops maestro_ioctl_ops = {
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index 4349213..2975f1c 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -346,7 +346,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
static const struct v4l2_file_operations maxiradio_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = {
diff --git a/drivers/media/radio/radio-miropcm20.c b/drivers/media/radio/radio-miropcm20.c
index 4ff8854..df4869f 100644
--- a/drivers/media/radio/radio-miropcm20.c
+++ b/drivers/media/radio/radio-miropcm20.c
@@ -72,7 +72,7 @@ static int pcm20_setfreq(struct pcm20 *dev, unsigned long freq)
static const struct v4l2_file_operations pcm20_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static int vidioc_querycap(struct file *file, void *priv,
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 02a9cef..8de8b2f 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -613,7 +613,7 @@ static const struct v4l2_file_operations usb_amradio_fops = {
.owner = THIS_MODULE,
.open = usb_amradio_open,
.release = usb_amradio_close,
- .ioctl = usb_amradio_ioctl,
+ .unlocked_ioctl = usb_amradio_ioctl,
};
static const struct v4l2_ioctl_ops usb_amradio_ioctl_ops = {
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c
index a79296a..12f4c1a 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -266,7 +266,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations rtrack2_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops rtrack2_ioctl_ops = {
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 985359d..c3d1415 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -260,7 +260,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations fmi_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops fmi_ioctl_ops = {
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index 52c7bbb..5a63e5c 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -376,7 +376,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations fmr2_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops fmr2_ioctl_ops = {
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index 13554ab..9b6264d 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -53,7 +53,7 @@ struct radio_si4713_device {
/* radio_si4713_fops - file operations interface */
static const struct v4l2_file_operations radio_si4713_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
/* Video4Linux Interface */
diff --git a/drivers/media/radio/radio-tea5764.c b/drivers/media/radio/radio-tea5764.c
index 789d2ec..9d24996 100644
--- a/drivers/media/radio/radio-tea5764.c
+++ b/drivers/media/radio/radio-tea5764.c
@@ -492,7 +492,7 @@ static const struct v4l2_file_operations tea5764_fops = {
.owner = THIS_MODULE,
.open = tea5764_open,
.release = tea5764_close,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops tea5764_ioctl_ops = {
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c
index fc1c860..e9f89e5 100644
--- a/drivers/media/radio/radio-terratec.c
+++ b/drivers/media/radio/radio-terratec.c
@@ -338,7 +338,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations terratec_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops terratec_ioctl_ops = {
diff --git a/drivers/media/radio/radio-timb.c b/drivers/media/radio/radio-timb.c
index b8bb3ef..083609d 100644
--- a/drivers/media/radio/radio-timb.c
+++ b/drivers/media/radio/radio-timb.c
@@ -142,7 +142,7 @@ static const struct v4l2_ioctl_ops timbradio_ioctl_ops = {
static const struct v4l2_file_operations timbradio_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static int __devinit timbradio_probe(struct platform_device *pdev)
diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c
index 9d6dcf8..c5813ff 100644
--- a/drivers/media/radio/radio-trust.c
+++ b/drivers/media/radio/radio-trust.c
@@ -344,7 +344,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations trust_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops trust_ioctl_ops = {
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index 0343928..6c0431d 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -320,7 +320,7 @@ static int vidioc_log_status(struct file *file, void *priv)
static const struct v4l2_file_operations typhoon_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops typhoon_ioctl_ops = {
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index f31eab9..72e4ecf 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -377,7 +377,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
static const struct v4l2_file_operations zoltrix_fops =
{
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops zoltrix_ioctl_ops = {
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c
index 47075fc..293f30a 100644
--- a/drivers/media/radio/si470x/radio-si470x-common.c
+++ b/drivers/media/radio/si470x/radio-si470x-common.c
@@ -516,7 +516,7 @@ static const struct v4l2_file_operations si470x_fops = {
.owner = THIS_MODULE,
.read = si470x_fops_read,
.poll = si470x_fops_poll,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.open = si470x_fops_open,
.release = si470x_fops_release,
};
diff --git a/drivers/media/video/arv.c b/drivers/media/video/arv.c
index 31e7a12..f989f28 100644
--- a/drivers/media/video/arv.c
+++ b/drivers/media/video/arv.c
@@ -712,7 +712,7 @@ static int ar_initialize(struct ar *ar)
static const struct v4l2_file_operations ar_fops = {
.owner = THIS_MODULE,
.read = ar_read,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops ar_ioctl_ops = {
diff --git a/drivers/media/video/au0828/au0828-video.c b/drivers/media/video/au0828/au0828-video.c
index 6615021..206b31b 100644
--- a/drivers/media/video/au0828/au0828-video.c
+++ b/drivers/media/video/au0828/au0828-video.c
@@ -1512,13 +1512,13 @@ static int vidiocgmbuf(struct file *file, void *priv, struct video_mbuf *mbuf)
#endif
static struct v4l2_file_operations au0828_v4l_fops = {
- .owner = THIS_MODULE,
- .open = au0828_v4l2_open,
- .release = au0828_v4l2_close,
- .read = au0828_v4l2_read,
- .poll = au0828_v4l2_poll,
- .mmap = au0828_v4l2_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = au0828_v4l2_open,
+ .release = au0828_v4l2_close,
+ .read = au0828_v4l2_read,
+ .poll = au0828_v4l2_poll,
+ .mmap = au0828_v4l2_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 350e7af..a40f76b 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3338,13 +3338,13 @@ bttv_mmap(struct file *file, struct vm_area_struct *vma)
static const struct v4l2_file_operations bttv_fops =
{
- .owner = THIS_MODULE,
- .open = bttv_open,
- .release = bttv_release,
- .ioctl = video_ioctl2,
- .read = bttv_read,
- .mmap = bttv_mmap,
- .poll = bttv_poll,
+ .owner = THIS_MODULE,
+ .open = bttv_open,
+ .release = bttv_release,
+ .unlocked_ioctl = video_ioctl2,
+ .read = bttv_read,
+ .mmap = bttv_mmap,
+ .poll = bttv_poll,
};
static const struct v4l2_ioctl_ops bttv_ioctl_ops = {
@@ -3611,12 +3611,12 @@ static unsigned int radio_poll(struct file *file, poll_table *wait)
static const struct v4l2_file_operations radio_fops =
{
- .owner = THIS_MODULE,
- .open = radio_open,
- .read = radio_read,
- .release = radio_release,
- .ioctl = video_ioctl2,
- .poll = radio_poll,
+ .owner = THIS_MODULE,
+ .open = radio_open,
+ .read = radio_read,
+ .release = radio_release,
+ .unlocked_ioctl = video_ioctl2,
+ .poll = radio_poll,
};
static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index be35e69..8182477 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -1685,13 +1685,13 @@ static int cafe_vidioc_s_register(struct file *file, void *priv,
*/
static const struct v4l2_file_operations cafe_v4l_fops = {
- .owner = THIS_MODULE,
- .open = cafe_v4l_open,
- .release = cafe_v4l_release,
- .read = cafe_v4l_read,
- .poll = cafe_v4l_poll,
- .mmap = cafe_v4l_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = cafe_v4l_open,
+ .release = cafe_v4l_release,
+ .read = cafe_v4l_read,
+ .poll = cafe_v4l_poll,
+ .mmap = cafe_v4l_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops cafe_v4l_ioctl_ops = {
diff --git a/drivers/media/video/cx18/cx18-streams.c b/drivers/media/video/cx18/cx18-streams.c
index 054450f..85e4b73 100644
--- a/drivers/media/video/cx18/cx18-streams.c
+++ b/drivers/media/video/cx18/cx18-streams.c
@@ -37,13 +37,13 @@
#define CX18_DSP0_INTERRUPT_MASK 0xd0004C
static struct v4l2_file_operations cx18_v4l2_enc_fops = {
- .owner = THIS_MODULE,
- .read = cx18_v4l2_read,
- .open = cx18_v4l2_open,
+ .owner = THIS_MODULE,
+ .read = cx18_v4l2_read,
+ .open = cx18_v4l2_open,
/* FIXME change to video_ioctl2 if serialization lock can be removed */
- .ioctl = cx18_v4l2_ioctl,
- .release = cx18_v4l2_close,
- .poll = cx18_v4l2_enc_poll,
+ .unlocked_ioctl = cx18_v4l2_ioctl,
+ .release = cx18_v4l2_close,
+ .poll = cx18_v4l2_enc_poll,
};
/* offset from 0 to register ts v4l2 minors on */
diff --git a/drivers/media/video/cx231xx/cx231xx-video.c b/drivers/media/video/cx231xx/cx231xx-video.c
index 597c416..148e17a 100644
--- a/drivers/media/video/cx231xx/cx231xx-video.c
+++ b/drivers/media/video/cx231xx/cx231xx-video.c
@@ -2231,7 +2231,7 @@ static const struct v4l2_file_operations cx231xx_v4l_fops = {
.read = cx231xx_v4l2_read,
.poll = cx231xx_v4l2_poll,
.mmap = cx231xx_v4l2_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -2289,7 +2289,7 @@ static const struct v4l2_file_operations radio_fops = {
.owner = THIS_MODULE,
.open = cx231xx_v4l2_open,
.release = cx231xx_v4l2_close,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c
index abd64e8..568f4d6 100644
--- a/drivers/media/video/cx23885/cx23885-417.c
+++ b/drivers/media/video/cx23885/cx23885-417.c
@@ -1681,7 +1681,7 @@ static struct v4l2_file_operations mpeg_fops = {
.read = mpeg_read,
.poll = mpeg_poll,
.mmap = mpeg_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 543b854..e3bed13 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -1387,7 +1387,7 @@ static const struct v4l2_file_operations video_fops = {
.read = video_read,
.poll = video_poll,
.mmap = video_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1439,7 +1439,7 @@ static const struct v4l2_file_operations radio_fops = {
.owner = THIS_MODULE,
.open = video_open,
.release = video_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index e46e1ce..ca63ce2 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1174,7 +1174,7 @@ static const struct v4l2_file_operations mpeg_fops =
.read = mpeg_read,
.poll = mpeg_poll,
.mmap = mpeg_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index 0fab65c..25b19dd 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1683,7 +1683,7 @@ static const struct v4l2_file_operations video_fops =
.read = video_read,
.poll = video_poll,
.mmap = video_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -1736,7 +1736,7 @@ static const struct v4l2_file_operations radio_fops =
.owner = THIS_MODULE,
.open = video_open,
.release = video_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 2e5a7fb..408ecdf 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -1836,7 +1836,7 @@ static struct v4l2_file_operations vpif_fops = {
.owner = THIS_MODULE,
.open = vpif_open,
.release = vpif_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.mmap = vpif_mmap,
.poll = vpif_poll
};
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index e5bab3d..1adfc36 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -1340,7 +1340,7 @@ static const struct v4l2_file_operations vpif_fops = {
.owner = THIS_MODULE,
.open = vpif_open,
.release = vpif_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.mmap = vpif_mmap,
.poll = vpif_poll
};
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index b6ac99d..dc4bb70 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -2387,7 +2387,7 @@ static const struct v4l2_file_operations em28xx_v4l_fops = {
.read = em28xx_v4l2_read,
.poll = em28xx_v4l2_poll,
.mmap = em28xx_v4l2_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -2449,7 +2449,7 @@ static const struct v4l2_file_operations radio_fops = {
.owner = THIS_MODULE,
.open = em28xx_v4l2_open,
.release = em28xx_v4l2_close,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c
index bb9fdb7..b581a3d 100644
--- a/drivers/media/video/meye.c
+++ b/drivers/media/video/meye.c
@@ -1659,7 +1659,7 @@ static const struct v4l2_file_operations meye_fops = {
.open = meye_open,
.release = meye_release,
.mmap = meye_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.poll = meye_poll,
};
diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 1c05017..6f15bd1 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1554,11 +1554,11 @@ static int omap24xxcam_release(struct file *file)
}
static struct v4l2_file_operations omap24xxcam_fops = {
- .ioctl = video_ioctl2,
- .poll = omap24xxcam_poll,
- .mmap = omap24xxcam_mmap,
- .open = omap24xxcam_open,
- .release = omap24xxcam_release,
+ .unlocked_ioctl = video_ioctl2,
+ .poll = omap24xxcam_poll,
+ .mmap = omap24xxcam_mmap,
+ .open = omap24xxcam_open,
+ .release = omap24xxcam_release,
};
/*
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index 7129b50..7551907 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -932,7 +932,7 @@ static ssize_t pms_read(struct file *file, char __user *buf,
static const struct v4l2_file_operations pms_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.read = pms_read,
};
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index 4dc001b..9db5968 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -1890,12 +1890,12 @@ static int s2255_mmap_v4l(struct file *file, struct vm_area_struct *vma)
}
static const struct v4l2_file_operations s2255_fops_v4l = {
- .owner = THIS_MODULE,
- .open = s2255_open,
- .release = s2255_release,
- .poll = s2255_poll,
- .ioctl = video_ioctl2, /* V4L2 ioctl handler */
- .mmap = s2255_mmap_v4l,
+ .owner = THIS_MODULE,
+ .open = s2255_open,
+ .release = s2255_release,
+ .poll = s2255_poll,
+ .unlocked_ioctl = video_ioctl2, /* V4L2 ioctl handler */
+ .mmap = s2255_mmap_v4l,
};
static const struct v4l2_ioctl_ops s2255_ioctl_ops = {
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index ea877a5..d503aae 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -438,13 +438,13 @@ static int empress_g_std(struct file *file, void *priv, v4l2_std_id *id)
static const struct v4l2_file_operations ts_fops =
{
- .owner = THIS_MODULE,
- .open = ts_open,
- .release = ts_release,
- .read = ts_read,
- .poll = ts_poll,
- .mmap = ts_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = ts_open,
+ .release = ts_release,
+ .read = ts_read,
+ .poll = ts_poll,
+ .mmap = ts_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops ts_ioctl_ops = {
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 7806fb1..c142071 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -2409,13 +2409,13 @@ static int radio_queryctrl(struct file *file, void *priv,
static const struct v4l2_file_operations video_fops =
{
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
@@ -2470,12 +2470,12 @@ static const struct v4l2_ioctl_ops video_ioctl_ops = {
};
static const struct v4l2_file_operations radio_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .read = radio_read,
- .release = video_release,
- .ioctl = video_ioctl2,
- .poll = radio_poll,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .read = radio_read,
+ .release = video_release,
+ .unlocked_ioctl = video_ioctl2,
+ .poll = radio_poll,
};
static const struct v4l2_ioctl_ops radio_ioctl_ops = {
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 30f5c41..04fb6cf 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -513,7 +513,7 @@ static struct v4l2_file_operations soc_camera_fops = {
.owner = THIS_MODULE,
.open = soc_camera_open,
.release = soc_camera_close,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.read = soc_camera_read,
.mmap = soc_camera_mmap,
.poll = soc_camera_poll,
diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c
index f07a0f6..fb993c8 100644
--- a/drivers/media/video/stk-webcam.c
+++ b/drivers/media/video/stk-webcam.c
@@ -1263,13 +1263,13 @@ static int stk_vidioc_enum_framesizes(struct file *filp,
}
static struct v4l2_file_operations v4l_stk_fops = {
- .owner = THIS_MODULE,
- .open = v4l_stk_open,
- .release = v4l_stk_release,
- .read = v4l_stk_read,
- .poll = v4l_stk_poll,
- .mmap = v4l_stk_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = v4l_stk_open,
+ .release = v4l_stk_release,
+ .read = v4l_stk_read,
+ .poll = v4l_stk_poll,
+ .mmap = v4l_stk_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops v4l_stk_ioctl_ops = {
diff --git a/drivers/media/video/tlg2300/pd-radio.c b/drivers/media/video/tlg2300/pd-radio.c
index fae84c2..29a4d7f 100644
--- a/drivers/media/video/tlg2300/pd-radio.c
+++ b/drivers/media/video/tlg2300/pd-radio.c
@@ -155,10 +155,10 @@ static int vidioc_querycap(struct file *file, void *priv,
}
static const struct v4l2_file_operations poseidon_fm_fops = {
- .owner = THIS_MODULE,
- .open = poseidon_fm_open,
- .release = poseidon_fm_close,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = poseidon_fm_open,
+ .release = poseidon_fm_close,
+ .unlocked_ioctl = video_ioctl2,
};
static int tlg_fm_vidioc_g_tuner(struct file *file, void *priv,
diff --git a/drivers/media/video/tlg2300/pd-video.c b/drivers/media/video/tlg2300/pd-video.c
index c750fd1..0e95a3d 100644
--- a/drivers/media/video/tlg2300/pd-video.c
+++ b/drivers/media/video/tlg2300/pd-video.c
@@ -1542,7 +1542,7 @@ static const struct v4l2_file_operations pd_video_fops = {
.read = pd_video_read,
.poll = pd_video_poll,
.mmap = pd_video_mmap,
- .ioctl = video_ioctl2, /* maybe changed in future */
+ .unlocked_ioctl = video_ioctl2, /* maybe changed in future */
};
static const struct v4l2_ioctl_ops pd_video_ioctl_ops = {
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index d91f016..0f47f4a 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -1251,7 +1251,7 @@ static const struct v4l2_file_operations usbvision_fops = {
.release = usbvision_v4l2_close,
.read = usbvision_v4l2_read,
.mmap = usbvision_v4l2_mmap,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
/* .poll = video_poll, */
};
@@ -1304,7 +1304,7 @@ static const struct v4l2_file_operations usbvision_radio_fops = {
.owner = THIS_MODULE,
.open = usbvision_radio_open,
.release = usbvision_radio_close,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops usbvision_radio_ioctl_ops = {
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 635420d..42d5661 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -815,7 +815,7 @@ out:
static const struct v4l2_file_operations w9966_fops = {
.owner = THIS_MODULE,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.read = w9966_v4l_read,
};
diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c
index 6f89d0a..85bbf58 100644
--- a/drivers/media/video/zoran/zoran_driver.c
+++ b/drivers/media/video/zoran/zoran_driver.c
@@ -3371,14 +3371,14 @@ static const struct v4l2_ioctl_ops zoran_ioctl_ops = {
};
static const struct v4l2_file_operations zoran_fops = {
- .owner = THIS_MODULE,
- .open = zoran_open,
- .release = zoran_close,
- .ioctl = video_ioctl2,
- .read = zoran_read,
- .write = zoran_write,
- .mmap = zoran_mmap,
- .poll = zoran_poll,
+ .owner = THIS_MODULE,
+ .open = zoran_open,
+ .release = zoran_close,
+ .unlocked_ioctl = video_ioctl2,
+ .read = zoran_read,
+ .write = zoran_write,
+ .mmap = zoran_mmap,
+ .poll = zoran_poll,
};
struct video_device zoran_template __devinitdata = {
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index a82b5bd..35a53e0 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -1438,13 +1438,13 @@ static unsigned int zr364xx_poll(struct file *file,
}
static const struct v4l2_file_operations zr364xx_fops = {
- .owner = THIS_MODULE,
- .open = zr364xx_open,
- .release = zr364xx_release,
- .read = zr364xx_read,
- .mmap = zr364xx_mmap,
- .ioctl = video_ioctl2,
- .poll = zr364xx_poll,
+ .owner = THIS_MODULE,
+ .open = zr364xx_open,
+ .release = zr364xx_release,
+ .read = zr364xx_read,
+ .mmap = zr364xx_mmap,
+ .unlocked_ioctl = video_ioctl2,
+ .poll = zr364xx_poll,
};
static const struct v4l2_ioctl_ops zr364xx_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video0.c b/drivers/staging/cx25821/cx25821-video0.c
index 1f95ddb..c8727db 100644
--- a/drivers/staging/cx25821/cx25821-video0.c
+++ b/drivers/staging/cx25821/cx25821-video0.c
@@ -373,13 +373,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video1.c b/drivers/staging/cx25821/cx25821-video1.c
index 9b94462..2fd02d7 100644
--- a/drivers/staging/cx25821/cx25821-video1.c
+++ b/drivers/staging/cx25821/cx25821-video1.c
@@ -373,13 +373,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
//exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video2.c b/drivers/staging/cx25821/cx25821-video2.c
index 31c46aa..bdcca2b 100644
--- a/drivers/staging/cx25821/cx25821-video2.c
+++ b/drivers/staging/cx25821/cx25821-video2.c
@@ -375,13 +375,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video3.c b/drivers/staging/cx25821/cx25821-video3.c
index cbc5cad..48e54af 100644
--- a/drivers/staging/cx25821/cx25821-video3.c
+++ b/drivers/staging/cx25821/cx25821-video3.c
@@ -374,13 +374,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video4.c b/drivers/staging/cx25821/cx25821-video4.c
index 101074a..abd8bda 100644
--- a/drivers/staging/cx25821/cx25821-video4.c
+++ b/drivers/staging/cx25821/cx25821-video4.c
@@ -373,13 +373,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video5.c b/drivers/staging/cx25821/cx25821-video5.c
index 2019c5e..003266e 100644
--- a/drivers/staging/cx25821/cx25821-video5.c
+++ b/drivers/staging/cx25821/cx25821-video5.c
@@ -373,13 +373,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video6.c b/drivers/staging/cx25821/cx25821-video6.c
index d19c786..a838251 100644
--- a/drivers/staging/cx25821/cx25821-video6.c
+++ b/drivers/staging/cx25821/cx25821-video6.c
@@ -373,13 +373,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-video7.c b/drivers/staging/cx25821/cx25821-video7.c
index 8a7c854..6fd6115 100644
--- a/drivers/staging/cx25821/cx25821-video7.c
+++ b/drivers/staging/cx25821/cx25821-video7.c
@@ -372,13 +372,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl2,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/go7007/go7007-v4l2.c b/drivers/staging/go7007/go7007-v4l2.c
index 723c1a6..b71fb3f 100644
--- a/drivers/staging/go7007/go7007-v4l2.c
+++ b/drivers/staging/go7007/go7007-v4l2.c
@@ -1743,7 +1743,7 @@ static struct v4l2_file_operations go7007_fops = {
.owner = THIS_MODULE,
.open = go7007_open,
.release = go7007_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
.read = go7007_read,
.mmap = go7007_mmap,
.poll = go7007_poll,
diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c
index c53de47..b2db64b 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1455,7 +1455,7 @@ static struct v4l2_file_operations tm6000_fops = {
.owner = THIS_MODULE,
.open = tm6000_open,
.release = tm6000_release,
- .ioctl = video_ioctl2, /* V4L2 ioctl handler */
+ .unlocked_ioctl = video_ioctl2, /* V4L2 ioctl handler */
.read = tm6000_read,
.poll = tm6000_poll,
.mmap = tm6000_mmap,
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index ee538f1..aad79f4 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -265,7 +265,7 @@ static const struct v4l2_file_operations tea575x_fops = {
.owner = THIS_MODULE,
.open = snd_tea575x_exclusive_open,
.release = snd_tea575x_exclusive_release,
- .ioctl = video_ioctl2,
+ .unlocked_ioctl = video_ioctl2,
};
static const struct v4l2_ioctl_ops tea575x_ioctl_ops = {
--
1.6.2.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 4/5] v4l: Pushdown bkl to drivers that implement their own ioctl
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
` (3 preceding siblings ...)
2010-04-29 3:42 ` [PATCH 3/5] v4l: Change users of video_ioctl2 to use unlocked_ioctl Frederic Weisbecker
@ 2010-04-29 3:42 ` Frederic Weisbecker
4 siblings, 0 replies; 12+ messages in thread
From: Frederic Weisbecker @ 2010-04-29 3:42 UTC (permalink / raw)
To: LKML
Cc: LKML, Frederic Weisbecker, Laurent Pinchart, Hans Verkuil,
Arnd Bergmann, John Kacur, Linus Torvalds, Jan Blunck,
Thomas Gleixner, Mauro Carvalho Chehab, Linux Media Mailing List
These are the last remaining v4l drivers that implement the ioctl
callback.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
---
drivers/media/video/bw-qcam.c | 11 ++++++++-
drivers/media/video/c-qcam.c | 11 ++++++++-
drivers/media/video/cpia.c | 11 ++++++++-
drivers/media/video/cpia2/cpia2_v4l.c | 11 ++++++++-
drivers/media/video/et61x251/et61x251_core.c | 27 +++++++++++++++++++------
drivers/media/video/ov511.c | 15 ++++++++-----
drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 20 ++++++++++++------
drivers/media/video/pwc/pwc-if.c | 19 ++++++++++-------
drivers/media/video/saa5246a.c | 11 ++++++---
drivers/media/video/saa5249.c | 6 ++++-
drivers/media/video/se401.c | 20 ++++++++++++------
drivers/media/video/sn9c102/sn9c102_core.c | 27 +++++++++++++++++++------
drivers/media/video/stradis.c | 26 ++++++++++++++++++------
drivers/media/video/stv680.c | 20 ++++++++++++------
drivers/media/video/usbvideo/usbvideo.c | 21 +++++++++++++------
drivers/media/video/usbvideo/vicam.c | 14 ++++++++++++-
drivers/media/video/uvc/uvc_v4l2.c | 11 ++++++++-
drivers/media/video/vivi.c | 2 +-
drivers/media/video/w9968cf.c | 25 ++++++++++++++++++-----
drivers/media/video/zc0301/zc0301_core.c | 27 +++++++++++++++++++------
drivers/staging/cx25821/cx25821-audups11.c | 18 ++++++++++------
drivers/staging/cx25821/cx25821-videoioctl.c | 27 +++++++++++++++++++------
drivers/staging/cx25821/cx25821-vidups10.c | 19 +++++++++++------
drivers/staging/cx25821/cx25821-vidups9.c | 18 ++++++++++------
drivers/staging/dream/camera/msm_v4l2.c | 27 ++++++++++++++++++-------
25 files changed, 315 insertions(+), 129 deletions(-)
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 3c9e754..11367b0 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -76,6 +76,7 @@ OTHER DEALINGS IN THE SOFTWARE.
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include "bw-qcam.h"
@@ -831,7 +832,13 @@ static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long qcam_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, qcam_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, qcam_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
static ssize_t qcam_read(struct file *file, char __user *buf,
@@ -879,7 +886,7 @@ static const struct v4l2_file_operations qcam_fops = {
.owner = THIS_MODULE,
.open = qcam_exclusive_open,
.release = qcam_exclusive_release,
- .ioctl = qcam_ioctl,
+ .unlocked_ioctl = qcam_ioctl,
.read = qcam_read,
};
static struct video_device qcam_template = {
diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
index 8f1dd88..0eb42fd 100644
--- a/drivers/media/video/c-qcam.c
+++ b/drivers/media/video/c-qcam.c
@@ -38,6 +38,7 @@
#include <media/v4l2-ioctl.h>
#include <linux/mutex.h>
#include <linux/jiffies.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
@@ -663,7 +664,13 @@ static long qcam_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long qcam_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, qcam_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, qcam_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
static ssize_t qcam_read(struct file *file, char __user *buf,
@@ -704,7 +711,7 @@ static const struct v4l2_file_operations qcam_fops = {
.owner = THIS_MODULE,
.open = qcam_exclusive_open,
.release = qcam_exclusive_release,
- .ioctl = qcam_ioctl,
+ .unlocked_ioctl = qcam_ioctl,
.read = qcam_read,
};
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 933ae4c..f3f08cc 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -38,6 +38,7 @@
#include <linux/ctype.h>
#include <linux/pagemap.h>
#include <linux/delay.h>
+#include <linux/smp_lock.h>
#include <asm/io.h>
#include <linux/mutex.h>
@@ -3715,7 +3716,13 @@ static long cpia_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long cpia_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, cpia_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, cpia_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
@@ -3775,7 +3782,7 @@ static const struct v4l2_file_operations cpia_fops = {
.release = cpia_close,
.read = cpia_read,
.mmap = cpia_mmap,
- .ioctl = cpia_ioctl,
+ .unlocked_ioctl = cpia_ioctl,
};
static struct video_device cpia_template = {
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 6f91415..835172d 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -39,6 +39,7 @@
#include <linux/init.h>
#include <linux/videodev.h>
#include <linux/stringify.h>
+#include <linux/smp_lock.h>
#include <media/v4l2-ioctl.h>
#include "cpia2.h"
@@ -1840,7 +1841,13 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long cpia2_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, cpia2_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, cpia2_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
/******************************************************************************
@@ -1914,7 +1921,7 @@ static const struct v4l2_file_operations fops_template = {
.release = cpia2_close,
.read = cpia2_v4l_read,
.poll = cpia2_v4l_poll,
- .ioctl = cpia2_ioctl,
+ .unlocked_ioctl = cpia2_ioctl,
.mmap = cpia2_mmap,
};
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index a5cfc76..2f64a24 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -34,6 +34,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/page-flags.h>
+#include <linux/smp_lock.h>
#include <media/v4l2-ioctl.h>
#include <asm/byteorder.h>
#include <asm/page.h>
@@ -2525,15 +2526,27 @@ static long et61x251_ioctl(struct file *filp,
return err;
}
+static long
+et61x251_locked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = et61x251_ioctl(filp, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
static const struct v4l2_file_operations et61x251_fops = {
- .owner = THIS_MODULE,
- .open = et61x251_open,
- .release = et61x251_release,
- .ioctl = et61x251_ioctl,
- .read = et61x251_read,
- .poll = et61x251_poll,
- .mmap = et61x251_mmap,
+ .owner = THIS_MODULE,
+ .open = et61x251_open,
+ .release = et61x251_release,
+ .unlocked_ioctl = et61x251_locked_ioctl,
+ .read = et61x251_read,
+ .poll = et61x251_poll,
+ .mmap = et61x251_mmap,
};
/*****************************************************************************/
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 6085d55..51ff18f 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -44,6 +44,7 @@
#include <asm/processor.h>
#include <linux/mm.h>
#include <linux/device.h>
+#include <linux/smp_lock.h>
#if defined (__i386__)
#include <asm/cpufeature.h>
@@ -4460,7 +4461,9 @@ ov51x_v4l1_ioctl(struct file *file,
if (mutex_lock_interruptible(&ov->lock))
return -EINTR;
+ lock_kernel();
rc = video_usercopy(file, cmd, arg, ov51x_v4l1_ioctl_internal);
+ unlock_kernel();
mutex_unlock(&ov->lock);
return rc;
@@ -4662,12 +4665,12 @@ ov51x_v4l1_mmap(struct file *file, struct vm_area_struct *vma)
}
static const struct v4l2_file_operations ov511_fops = {
- .owner = THIS_MODULE,
- .open = ov51x_v4l1_open,
- .release = ov51x_v4l1_close,
- .read = ov51x_v4l1_read,
- .mmap = ov51x_v4l1_mmap,
- .ioctl = ov51x_v4l1_ioctl,
+ .owner = THIS_MODULE,
+ .open = ov51x_v4l1_open,
+ .release = ov51x_v4l1_close,
+ .read = ov51x_v4l1_read,
+ .mmap = ov51x_v4l1_mmap,
+ .unlocked_ioctl = ov51x_v4l1_ioctl,
};
static struct video_device vdev_template = {
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index fe4159d..0cbc84a 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -22,6 +22,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/version.h>
+#include <linux/smp_lock.h>
#include "pvrusb2-context.h"
#include "pvrusb2-hdw.h"
#include "pvrusb2.h"
@@ -950,8 +951,13 @@ static void pvr2_v4l2_internal_check(struct pvr2_channel *chp)
static long pvr2_v4l2_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
+ long ret;
- return video_usercopy(file, cmd, arg, pvr2_v4l2_do_ioctl);
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, pvr2_v4l2_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
@@ -1231,12 +1237,12 @@ static unsigned int pvr2_v4l2_poll(struct file *file, poll_table *wait)
static const struct v4l2_file_operations vdev_fops = {
- .owner = THIS_MODULE,
- .open = pvr2_v4l2_open,
- .release = pvr2_v4l2_release,
- .read = pvr2_v4l2_read,
- .ioctl = pvr2_v4l2_ioctl,
- .poll = pvr2_v4l2_poll,
+ .owner = THIS_MODULE,
+ .open = pvr2_v4l2_open,
+ .release = pvr2_v4l2_release,
+ .read = pvr2_v4l2_read,
+ .unlocked_ioctl = pvr2_v4l2_ioctl,
+ .poll = pvr2_v4l2_poll,
};
diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c
index aea7e22..cb9c93d 100644
--- a/drivers/media/video/pwc/pwc-if.c
+++ b/drivers/media/video/pwc/pwc-if.c
@@ -157,13 +157,13 @@ static long pwc_video_ioctl(struct file *file,
static int pwc_video_mmap(struct file *file, struct vm_area_struct *vma);
static const struct v4l2_file_operations pwc_fops = {
- .owner = THIS_MODULE,
- .open = pwc_video_open,
- .release = pwc_video_close,
- .read = pwc_video_read,
- .poll = pwc_video_poll,
- .mmap = pwc_video_mmap,
- .ioctl = pwc_video_ioctl,
+ .owner = THIS_MODULE,
+ .open = pwc_video_open,
+ .release = pwc_video_close,
+ .read = pwc_video_read,
+ .poll = pwc_video_poll,
+ .mmap = pwc_video_mmap,
+ .unlocked_ioctl = pwc_video_ioctl,
};
static struct video_device pwc_template = {
.name = "Philips Webcam", /* Filled in later */
@@ -1424,8 +1424,11 @@ static long pwc_video_ioctl(struct file *file,
pdev = video_get_drvdata(vdev);
mutex_lock(&pdev->modlock);
- if (!pdev->unplugged)
+ if (!pdev->unplugged) {
+ lock_kernel();
r = video_usercopy(file, cmd, arg, pwc_video_do_ioctl);
+ unlock_kernel();
+ }
mutex_unlock(&pdev->modlock);
out:
return r;
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 6b3b09e..095ce9c 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -47,6 +47,7 @@
#include <linux/mutex.h>
#include <linux/videotext.h>
#include <linux/videodev2.h>
+#include <linux/smp_lock.h>
#include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ioctl.h>
@@ -962,7 +963,9 @@ static long saa5246a_ioctl(struct file *file,
cmd = vtx_fix_command(cmd);
mutex_lock(&t->lock);
+ lock_kernel();
err = video_usercopy(file, cmd, arg, do_saa5246a_ioctl);
+ lock_kernel();
mutex_unlock(&t->lock);
return err;
}
@@ -1026,10 +1029,10 @@ static int saa5246a_release(struct file *file)
}
static const struct v4l2_file_operations saa_fops = {
- .owner = THIS_MODULE,
- .open = saa5246a_open,
- .release = saa5246a_release,
- .ioctl = saa5246a_ioctl,
+ .owner = THIS_MODULE,
+ .open = saa5246a_open,
+ .release = saa5246a_release,
+ .unlocked_ioctl = saa5246a_ioctl,
};
static struct video_device saa_template =
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 31ff27d..279c204 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -51,6 +51,7 @@
#include <linux/videotext.h>
#include <linux/videodev2.h>
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include <media/v4l2-device.h>
#include <media/v4l2-chip-ident.h>
#include <media/v4l2-ioctl.h>
@@ -498,8 +499,11 @@ static long saa5249_ioctl(struct file *file,
cmd = vtx_fix_command(cmd);
mutex_lock(&t->lock);
+ lock_kernel();
err = video_usercopy(file, cmd, arg, do_saa5249_ioctl);
+ unlock_kernel();
mutex_unlock(&t->lock);
+
return err;
}
@@ -551,7 +555,7 @@ static const struct v4l2_file_operations saa_fops = {
.owner = THIS_MODULE,
.open = saa5249_open,
.release = saa5249_release,
- .ioctl = saa5249_ioctl,
+ .unlocked_ioctl = saa5249_ioctl,
};
static struct video_device saa_template =
diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c
index 41d0166..285e31a 100644
--- a/drivers/media/video/se401.c
+++ b/drivers/media/video/se401.c
@@ -1154,7 +1154,13 @@ static long se401_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long se401_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, se401_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, se401_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
static ssize_t se401_read(struct file *file, char __user *buf,
@@ -1237,12 +1243,12 @@ static int se401_mmap(struct file *file, struct vm_area_struct *vma)
}
static const struct v4l2_file_operations se401_fops = {
- .owner = THIS_MODULE,
- .open = se401_open,
- .release = se401_close,
- .read = se401_read,
- .mmap = se401_mmap,
- .ioctl = se401_ioctl,
+ .owner = THIS_MODULE,
+ .open = se401_open,
+ .release = se401_close,
+ .read = se401_read,
+ .mmap = se401_mmap,
+ .unlocked_ioctl = se401_ioctl,
};
static struct video_device se401_template = {
.name = "se401 USB camera",
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 28e19da..843b56a 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -34,6 +34,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/page-flags.h>
+#include <linux/smp_lock.h>
#include <asm/byteorder.h>
#include <asm/page.h>
#include <asm/uaccess.h>
@@ -3232,16 +3233,28 @@ static long sn9c102_ioctl(struct file *filp,
return err;
}
+static long
+sn9c102_locked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = sn9c102_ioctl(filp, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
/*****************************************************************************/
static const struct v4l2_file_operations sn9c102_fops = {
- .owner = THIS_MODULE,
- .open = sn9c102_open,
- .release = sn9c102_release,
- .ioctl = sn9c102_ioctl,
- .read = sn9c102_read,
- .poll = sn9c102_poll,
- .mmap = sn9c102_mmap,
+ .owner = THIS_MODULE,
+ .open = sn9c102_open,
+ .release = sn9c102_release,
+ .unlocked_ioctl = sn9c102_locked_ioctl,
+ .read = sn9c102_read,
+ .poll = sn9c102_poll,
+ .mmap = sn9c102_mmap,
};
/*****************************************************************************/
diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c
index a057824..51e4d9b 100644
--- a/drivers/media/video/stradis.c
+++ b/drivers/media/video/stradis.c
@@ -1739,6 +1739,18 @@ static long saa_ioctl(struct file *file,
return 0;
}
+static long saa_locked_ioctl(struct file *file,
+ unsigned int cmd, unsigned long argl)
+{
+ long ret;
+
+ lock_kernel();
+ ret = saa_ioctl(file, cmd, argl);
+ unlock_kernel();
+
+ return ret;
+}
+
static int saa_mmap(struct file *file, struct vm_area_struct *vma)
{
struct saa7146 *saa = file->private_data;
@@ -1908,13 +1920,13 @@ static int saa_release(struct file *file)
}
static const struct v4l2_file_operations saa_fops = {
- .owner = THIS_MODULE,
- .open = saa_open,
- .release = saa_release,
- .ioctl = saa_ioctl,
- .read = saa_read,
- .write = saa_write,
- .mmap = saa_mmap,
+ .owner = THIS_MODULE,
+ .open = saa_open,
+ .release = saa_release,
+ .unlocked_ioctl = saa_locked_ioctl,
+ .read = saa_read,
+ .write = saa_write,
+ .mmap = saa_mmap,
};
/* template for video_device-structure */
diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c
index 5938ad8..675ae58 100644
--- a/drivers/media/video/stv680.c
+++ b/drivers/media/video/stv680.c
@@ -1304,7 +1304,13 @@ static long stv680_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long stv680_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, stv680_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, stv680_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
static int stv680_mmap (struct file *file, struct vm_area_struct *vma)
@@ -1394,12 +1400,12 @@ static ssize_t stv680_read (struct file *file, char __user *buf,
} /* stv680_read */
static const struct v4l2_file_operations stv680_fops = {
- .owner = THIS_MODULE,
- .open = stv_open,
- .release = stv_close,
- .read = stv680_read,
- .mmap = stv680_mmap,
- .ioctl = stv680_ioctl,
+ .owner = THIS_MODULE,
+ .open = stv_open,
+ .release = stv_close,
+ .read = stv680_read,
+ .mmap = stv680_mmap,
+ .unlocked_ioctl = stv680_ioctl,
};
static struct video_device stv680_template = {
.name = "STV0680 USB camera",
diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c
index 5ac37c6..b7865d8 100644
--- a/drivers/media/video/usbvideo/usbvideo.c
+++ b/drivers/media/video/usbvideo/usbvideo.c
@@ -23,6 +23,7 @@
#include <linux/vmalloc.h>
#include <linux/init.h>
#include <linux/spinlock.h>
+#include <linux/smp_lock.h>
#include <asm/io.h>
@@ -943,12 +944,12 @@ static int usbvideo_find_struct(struct usbvideo *cams)
}
static const struct v4l2_file_operations usbvideo_fops = {
- .owner = THIS_MODULE,
- .open = usbvideo_v4l_open,
- .release =usbvideo_v4l_close,
- .read = usbvideo_v4l_read,
- .mmap = usbvideo_v4l_mmap,
- .ioctl = usbvideo_v4l_ioctl,
+ .owner = THIS_MODULE,
+ .open = usbvideo_v4l_open,
+ .release = usbvideo_v4l_close,
+ .read = usbvideo_v4l_read,
+ .mmap = usbvideo_v4l_mmap,
+ .unlocked_ioctl = usbvideo_v4l_ioctl,
};
static const struct video_device usbvideo_template = {
.fops = &usbvideo_fops,
@@ -1500,7 +1501,13 @@ static long usbvideo_v4l_do_ioctl(struct file *file, unsigned int cmd, void *arg
static long usbvideo_v4l_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- return video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);
+ long ret;
+
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, usbvideo_v4l_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
/*
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 6030410..575a783 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -470,6 +470,18 @@ vicam_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg)
return retval;
}
+static long
+vicam_locked_ioctl(struct file *file, unsigned int ioctlnr, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = vicam_ioctl(file, ioctlnr, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
static int
vicam_open(struct file *file)
{
@@ -790,7 +802,7 @@ static const struct v4l2_file_operations vicam_fops = {
.release = vicam_close,
.read = vicam_read,
.mmap = vicam_mmap,
- .ioctl = vicam_ioctl,
+ .unlocked_ioctl = vicam_locked_ioctl,
};
static struct video_device vicam_template = {
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index 7c9ab29..3971fa3 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -21,6 +21,7 @@
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <linux/wait.h>
+#include <linux/smp_lock.h>
#include <asm/atomic.h>
#include <media/v4l2-common.h>
@@ -1029,13 +1030,19 @@ static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
static long uvc_v4l2_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
+ long ret;
+
if (uvc_trace_param & UVC_TRACE_IOCTL) {
uvc_printk(KERN_DEBUG, "uvc_v4l2_ioctl(");
v4l_printk_ioctl(cmd);
printk(")\n");
}
- return video_usercopy(file, cmd, arg, uvc_v4l2_do_ioctl);
+ lock_kernel();
+ ret = video_usercopy(file, cmd, arg, uvc_v4l2_do_ioctl);
+ unlock_kernel();
+
+ return ret;
}
static ssize_t uvc_v4l2_read(struct file *file, char __user *data,
@@ -1134,7 +1141,7 @@ const struct v4l2_file_operations uvc_fops = {
.owner = THIS_MODULE,
.open = uvc_v4l2_open,
.release = uvc_v4l2_release,
- .ioctl = uvc_v4l2_ioctl,
+ .unlocked_ioctl = uvc_v4l2_ioctl,
.read = uvc_v4l2_read,
.mmap = uvc_v4l2_mmap,
.poll = uvc_v4l2_poll,
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c
index 5a736b8..4e119a4 100644
--- a/drivers/media/video/vivi.c
+++ b/drivers/media/video/vivi.c
@@ -1264,7 +1264,7 @@ static const struct v4l2_file_operations vivi_fops = {
.release = vivi_close,
.read = vivi_read,
.poll = vivi_poll,
- .ioctl = video_ioctl2, /* V4L2 ioctl handler */
+ .unlocked_ioctl = video_ioctl2, /* V4L2 ioctl handler */
.mmap = vivi_mmap,
};
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index d807eea..149a192 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -39,6 +39,7 @@
#include <linux/ioctl.h>
#include <linux/delay.h>
#include <linux/stddef.h>
+#include <linux/smp_lock.h>
#include <asm/page.h>
#include <asm/uaccess.h>
#include <linux/page-flags.h>
@@ -2846,6 +2847,18 @@ w9968cf_ioctl(struct file *filp,
return err;
}
+static long
+w9968cf_locked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = w9968cf_ioctl(filp, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
static long w9968cf_v4l_ioctl(struct file *filp,
unsigned int cmd, void __user *arg)
@@ -3390,12 +3403,12 @@ ioctl_fail:
static const struct v4l2_file_operations w9968cf_fops = {
- .owner = THIS_MODULE,
- .open = w9968cf_open,
- .release = w9968cf_release,
- .read = w9968cf_read,
- .ioctl = w9968cf_ioctl,
- .mmap = w9968cf_mmap,
+ .owner = THIS_MODULE,
+ .open = w9968cf_open,
+ .release = w9968cf_release,
+ .read = w9968cf_read,
+ .unlocked_ioctl = w9968cf_locked_ioctl,
+ .mmap = w9968cf_mmap,
};
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index bb51cfb..b7c839b 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -38,6 +38,7 @@
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/page-flags.h>
+#include <linux/smp_lock.h>
#include <asm/byteorder.h>
#include <asm/page.h>
#include <asm/uaccess.h>
@@ -1927,15 +1928,27 @@ static long zc0301_ioctl(struct file *filp,
return err;
}
+static long
+zc0301_locked_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = zc0301_ioctl(filp, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
static const struct v4l2_file_operations zc0301_fops = {
- .owner = THIS_MODULE,
- .open = zc0301_open,
- .release = zc0301_release,
- .ioctl = zc0301_ioctl,
- .read = zc0301_read,
- .poll = zc0301_poll,
- .mmap = zc0301_mmap,
+ .owner = THIS_MODULE,
+ .open = zc0301_open,
+ .release = zc0301_release,
+ .unlocked_ioctl = zc0301_locked_ioctl,
+ .read = zc0301_read,
+ .poll = zc0301_poll,
+ .mmap = zc0301_mmap,
};
/*****************************************************************************/
diff --git a/drivers/staging/cx25821/cx25821-audups11.c b/drivers/staging/cx25821/cx25821-audups11.c
index 9193a6e..3b9a7ae 100644
--- a/drivers/staging/cx25821/cx25821-audups11.c
+++ b/drivers/staging/cx25821/cx25821-audups11.c
@@ -22,6 +22,7 @@
*/
#include <linux/slab.h>
+#include <linux/smp_lock.h>
#include "cx25821-video.h"
@@ -301,6 +302,7 @@ static long video_ioctl_upstream11(struct file *file, unsigned int cmd,
return 0;
}
+ lock_kernel();
dev->input_filename = data_from_user->input_filename;
dev->input_audiofilename = data_from_user->input_filename;
dev->vid_stdname = data_from_user->vid_stdname;
@@ -318,6 +320,8 @@ static long video_ioctl_upstream11(struct file *file, unsigned int cmd,
break;
}
+ unlock_kernel();
+
return 0;
}
@@ -359,13 +363,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl_upstream11,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl_upstream11,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-videoioctl.c b/drivers/staging/cx25821/cx25821-videoioctl.c
index 840714a..b84ef90 100644
--- a/drivers/staging/cx25821/cx25821-videoioctl.c
+++ b/drivers/staging/cx25821/cx25821-videoioctl.c
@@ -21,6 +21,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/smp_lock.h>
#include "cx25821-video.h"
static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
@@ -387,6 +388,18 @@ static long video_ioctl_set(struct file *file, unsigned int cmd,
return 0;
}
+static long video_locked_ioctl_set(struct file *file, unsigned int cmd,
+ unsigned long arg)
+{
+ long ret;
+
+ lock_kernel();
+ ret = video_ioctl_set(file, cmd, arg);
+ unlock_kernel();
+
+ return ret;
+}
+
static int vidioc_log_status(struct file *file, void *priv)
{
struct cx25821_dev *dev = ((struct cx25821_fh *)priv)->dev;
@@ -419,13 +432,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl_set,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_locked_ioctl_set,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-vidups10.c b/drivers/staging/cx25821/cx25821-vidups10.c
index 89c8592..52faff4 100644
--- a/drivers/staging/cx25821/cx25821-vidups10.c
+++ b/drivers/staging/cx25821/cx25821-vidups10.c
@@ -21,6 +21,7 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <linux/smp_lock.h>
#include "cx25821-video.h"
static void buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb)
@@ -271,6 +272,8 @@ static long video_ioctl_upstream10(struct file *file, unsigned int cmd,
return 0;
}
+ lock_kernel();
+
dev->input_filename_ch2 = data_from_user->input_filename;
dev->input_audiofilename = data_from_user->input_filename;
dev->vid_stdname_ch2 = data_from_user->vid_stdname;
@@ -288,6 +291,8 @@ static long video_ioctl_upstream10(struct file *file, unsigned int cmd,
break;
}
+ unlock_kernel();
+
return 0;
}
@@ -357,13 +362,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
//exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl_upstream10,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl_upstream10,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/cx25821/cx25821-vidups9.c b/drivers/staging/cx25821/cx25821-vidups9.c
index c8e8083..d30f906 100644
--- a/drivers/staging/cx25821/cx25821-vidups9.c
+++ b/drivers/staging/cx25821/cx25821-vidups9.c
@@ -271,6 +271,8 @@ static long video_ioctl_upstream9(struct file *file, unsigned int cmd,
return 0;
}
+ lock_kernel();
+
dev->input_filename = data_from_user->input_filename;
dev->input_audiofilename = data_from_user->input_filename;
dev->vid_stdname = data_from_user->vid_stdname;
@@ -288,6 +290,8 @@ static long video_ioctl_upstream9(struct file *file, unsigned int cmd,
break;
}
+ unlock_kernel();
+
return 0;
}
@@ -355,13 +359,13 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
// exported stuff
static const struct v4l2_file_operations video_fops = {
- .owner = THIS_MODULE,
- .open = video_open,
- .release = video_release,
- .read = video_read,
- .poll = video_poll,
- .mmap = cx25821_video_mmap,
- .ioctl = video_ioctl_upstream9,
+ .owner = THIS_MODULE,
+ .open = video_open,
+ .release = video_release,
+ .read = video_read,
+ .poll = video_poll,
+ .mmap = cx25821_video_mmap,
+ .unlocked_ioctl = video_ioctl_upstream9,
};
static const struct v4l2_ioctl_ops video_ioctl_ops = {
diff --git a/drivers/staging/dream/camera/msm_v4l2.c b/drivers/staging/dream/camera/msm_v4l2.c
index c276f2f..7744287 100644
--- a/drivers/staging/dream/camera/msm_v4l2.c
+++ b/drivers/staging/dream/camera/msm_v4l2.c
@@ -12,6 +12,7 @@
#include <linux/spinlock.h>
#include <linux/videodev2.h>
#include <linux/proc_fs.h>
+#include <linux/smp_lock.h>
#include <linux/slab.h>
#include <media/v4l2-dev.h>
#include <media/msm_camera.h>
@@ -99,6 +100,7 @@ static unsigned int msm_v4l2_poll(struct file *f, struct poll_table_struct *w)
static long msm_v4l2_ioctl(struct file *filep,
unsigned int cmd, unsigned long arg)
{
+ long ret;
struct msm_ctrl_cmd *ctrlcmd;
D("msm_v4l2_ioctl, cmd = %d, %d\n", cmd, __LINE__);
@@ -119,18 +121,27 @@ static long msm_v4l2_ioctl(struct file *filep,
D("msm_v4l2_ioctl, MSM_V4L2_START_SNAPSHOT v4l2 ioctl %d\n",
cmd);
ctrlcmd->type = MSM_V4L2_SNAPSHOT;
- return g_pmsm_v4l2_dev->drv->ctrl(g_pmsm_v4l2_dev->drv->sync,
+ lock_kernel();
+ ret = g_pmsm_v4l2_dev->drv->ctrl(g_pmsm_v4l2_dev->drv->sync,
ctrlcmd);
+ unlock_kernel();
+ return ret;
case MSM_V4L2_GET_PICTURE:
D("msm_v4l2_ioctl, MSM_V4L2_GET_PICTURE v4l2 ioctl %d\n", cmd);
ctrlcmd = (struct msm_ctrl_cmd *)arg;
- return g_pmsm_v4l2_dev->drv->get_pict(
+ lock_kernel();
+ ret = g_pmsm_v4l2_dev->drv->get_pict(
g_pmsm_v4l2_dev->drv->sync, ctrlcmd);
+ unlock_kernel();
+ return ret;
default:
D("msm_v4l2_ioctl, standard v4l2 ioctl %d\n", cmd);
- return video_ioctl2(filep, cmd, arg);
+ lock_kernel();
+ ret = video_ioctl2(filep, cmd, arg);
+ unlock_kernel();
+ return ret;
}
}
@@ -640,11 +651,11 @@ int msm_v4l2_read_proc(char *pbuf, char **start, off_t offset,
#endif
static const struct v4l2_file_operations msm_v4l2_fops = {
- .owner = THIS_MODULE,
- .open = msm_v4l2_open,
- .poll = msm_v4l2_poll,
- .release = msm_v4l2_release,
- .ioctl = msm_v4l2_ioctl,
+ .owner = THIS_MODULE,
+ .open = msm_v4l2_open,
+ .poll = msm_v4l2_poll,
+ .release = msm_v4l2_release,
+ .unlocked_ioctl = msm_v4l2_ioctl,
};
static void msm_v4l2_dev_init(struct msm_v4l2_device *pmsm_v4l2_dev)
--
1.6.2.3
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-04-29 3:42 ` [PATCH 0/5] Pushdown bkl from v4l ioctls Frederic Weisbecker
@ 2010-04-29 6:44 ` Hans Verkuil
2010-04-29 7:10 ` Laurent Pinchart
2010-05-01 11:11 ` Alan Cox
0 siblings, 2 replies; 12+ messages in thread
From: Hans Verkuil @ 2010-04-29 6:44 UTC (permalink / raw)
To: Frederic Weisbecker
Cc: LKML, Laurent Pinchart, Arnd Bergmann, John Kacur, Linus Torvalds,
Jan Blunck, Thomas Gleixner, Mauro Carvalho Chehab, Greg KH,
Linux Media Mailing List
On Thursday 29 April 2010 05:42:39 Frederic Weisbecker wrote:
> Hi,
>
> Linus suggested to rename struct v4l2_file_operations::ioctl
> into bkl_ioctl to eventually get something greppable and make
> its background explicit.
>
> While at it I thought it could be a good idea to just pushdown
> the bkl to every v4l drivers that have an .ioctl, so that we
> actually remove struct v4l2_file_operations::ioctl for good.
>
> It passed make allyesconfig on sparc.
> Please tell me what you think.
I much prefer to keep the bkl inside the v4l2 core. One reason is that I
think that we can replace the bkl in the core with a mutex. Still not
ideal of course, so the next step will be to implement proper locking in
each driver. For this some additional v4l infrastructure work needs to be
done. I couldn't proceed with that until the v4l events API patches went in,
and that happened yesterday.
So from my point of view the timeline is this:
1) I do the infrastructure work this weekend. This will make it much easier to
convert drivers to do proper locking. And it will also simplify v4l2_priority
handling, so I'm killing two birds with one stone :-)
2) Wait until Arnd's patch gets merged that pushes the bkl down to v4l2-dev.c
3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
global mutex. Those drivers that call the bkl themselves should probably be
converted to do proper locking, but there are only about 14 drivers that do
this. The other 60 or so drivers should work fine if a v4l2-dev global lock
is used. At this point the bkl is effectively removed from the v4l subsystem.
4) Work on the remaining 60 drivers to do proper locking and get rid of the
v4l2-dev global lock. This is probably less work than it sounds.
Since your patch moves everything down to the driver level it will actually
make this work harder rather than easier. And it touches almost all drivers
as well.
Regards,
Hans
>
> Thanks.
>
> Frederic Weisbecker (5):
> v4l: Pushdown bkl into video_ioctl2
> v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl
> v4l: Change users of video_ioctl2 to use unlocked_ioctl
> v4l: Pushdown bkl to drivers that implement their own ioctl
> v4l: Remove struct v4l2_file_operations::ioctl
>
> drivers/media/common/saa7146_fops.c | 2 +-
> drivers/media/radio/dsbr100.c | 2 +-
> drivers/media/radio/radio-aimslab.c | 2 +-
> drivers/media/radio/radio-aztech.c | 2 +-
> drivers/media/radio/radio-cadet.c | 2 +-
> drivers/media/radio/radio-gemtek-pci.c | 2 +-
> drivers/media/radio/radio-gemtek.c | 2 +-
> drivers/media/radio/radio-maestro.c | 2 +-
> drivers/media/radio/radio-maxiradio.c | 2 +-
> drivers/media/radio/radio-miropcm20.c | 2 +-
> drivers/media/radio/radio-mr800.c | 2 +-
> drivers/media/radio/radio-rtrack2.c | 2 +-
> drivers/media/radio/radio-sf16fmi.c | 2 +-
> drivers/media/radio/radio-sf16fmr2.c | 2 +-
> drivers/media/radio/radio-si4713.c | 2 +-
> drivers/media/radio/radio-tea5764.c | 2 +-
> drivers/media/radio/radio-terratec.c | 2 +-
> drivers/media/radio/radio-timb.c | 2 +-
> drivers/media/radio/radio-trust.c | 2 +-
> drivers/media/radio/radio-typhoon.c | 2 +-
> drivers/media/radio/radio-zoltrix.c | 2 +-
> drivers/media/radio/si470x/radio-si470x-common.c | 2 +-
> drivers/media/video/arv.c | 2 +-
> drivers/media/video/au0828/au0828-video.c | 14 ++++----
> drivers/media/video/bt8xx/bttv-driver.c | 26 +++++++-------
> drivers/media/video/bw-qcam.c | 11 +++++-
> drivers/media/video/c-qcam.c | 11 +++++-
> drivers/media/video/cafe_ccic.c | 14 ++++----
> drivers/media/video/cpia.c | 11 +++++-
> drivers/media/video/cpia2/cpia2_v4l.c | 11 +++++-
> drivers/media/video/cx18/cx18-streams.c | 12 +++---
> drivers/media/video/cx231xx/cx231xx-video.c | 4 +-
> drivers/media/video/cx23885/cx23885-417.c | 2 +-
> drivers/media/video/cx23885/cx23885-video.c | 4 +-
> drivers/media/video/cx88/cx88-blackbird.c | 2 +-
> drivers/media/video/cx88/cx88-video.c | 4 +-
> drivers/media/video/davinci/vpfe_capture.c | 2 +-
> drivers/media/video/davinci/vpif_capture.c | 2 +-
> drivers/media/video/davinci/vpif_display.c | 2 +-
> drivers/media/video/em28xx/em28xx-video.c | 4 +-
> drivers/media/video/et61x251/et61x251_core.c | 27 +++++++++++----
> drivers/media/video/gspca/gspca.c | 2 +-
> drivers/media/video/hdpvr/hdpvr-video.c | 2 +-
> drivers/media/video/meye.c | 2 +-
> drivers/media/video/omap24xxcam.c | 10 +++---
> drivers/media/video/ov511.c | 15 +++++---
> drivers/media/video/pms.c | 2 +-
> drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 20 +++++++----
> drivers/media/video/pwc/pwc-if.c | 19 ++++++----
> drivers/media/video/s2255drv.c | 12 +++---
> drivers/media/video/saa5246a.c | 11 ++++--
> drivers/media/video/saa5249.c | 6 +++-
> drivers/media/video/saa7134/saa7134-empress.c | 14 ++++----
> drivers/media/video/saa7134/saa7134-video.c | 26 +++++++-------
> drivers/media/video/se401.c | 20 +++++++----
> drivers/media/video/sn9c102/sn9c102_core.c | 27 +++++++++++----
> drivers/media/video/soc_camera.c | 2 +-
> drivers/media/video/stk-webcam.c | 14 ++++----
> drivers/media/video/stradis.c | 26 +++++++++++----
> drivers/media/video/stv680.c | 20 +++++++----
> drivers/media/video/tlg2300/pd-radio.c | 8 ++--
> drivers/media/video/tlg2300/pd-video.c | 2 +-
> drivers/media/video/usbvideo/usbvideo.c | 21 ++++++++----
> drivers/media/video/usbvideo/vicam.c | 14 +++++++-
> drivers/media/video/usbvision/usbvision-video.c | 4 +-
> drivers/media/video/uvc/uvc_v4l2.c | 11 +++++-
> drivers/media/video/v4l2-dev.c | 38 ++-------------------
> drivers/media/video/v4l2-ioctl.c | 17 ++++++++-
> drivers/media/video/vivi.c | 2 +-
> drivers/media/video/w9966.c | 2 +-
> drivers/media/video/w9968cf.c | 25 +++++++++++---
> drivers/media/video/zc0301/zc0301_core.c | 27 +++++++++++----
> drivers/media/video/zoran/zoran_driver.c | 16 ++++----
> drivers/media/video/zr364xx.c | 14 ++++----
> drivers/staging/cx25821/cx25821-audups11.c | 18 ++++++----
> drivers/staging/cx25821/cx25821-video0.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video1.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video2.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video3.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video4.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video5.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video6.c | 14 ++++----
> drivers/staging/cx25821/cx25821-video7.c | 14 ++++----
> drivers/staging/cx25821/cx25821-videoioctl.c | 27 +++++++++++----
> drivers/staging/cx25821/cx25821-vidups10.c | 19 +++++++----
> drivers/staging/cx25821/cx25821-vidups9.c | 18 ++++++----
> drivers/staging/dream/camera/msm_v4l2.c | 27 +++++++++++----
> drivers/staging/go7007/go7007-v4l2.c | 2 +-
> drivers/staging/tm6000/tm6000-video.c | 2 +-
> include/media/v4l2-dev.h | 1 -
> include/media/v4l2-ioctl.h | 2 +
> sound/i2c/other/tea575x-tuner.c | 2 +-
> 92 files changed, 530 insertions(+), 360 deletions(-)
>
--
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-04-29 6:44 ` Hans Verkuil
@ 2010-04-29 7:10 ` Laurent Pinchart
2010-04-29 7:38 ` Arnd Bergmann
2010-05-01 9:55 ` Hans Verkuil
2010-05-01 11:11 ` Alan Cox
1 sibling, 2 replies; 12+ messages in thread
From: Laurent Pinchart @ 2010-04-29 7:10 UTC (permalink / raw)
To: Hans Verkuil
Cc: Frederic Weisbecker, LKML, Arnd Bergmann, John Kacur,
Linus Torvalds, Jan Blunck, Thomas Gleixner,
Mauro Carvalho Chehab, Greg KH, Linux Media Mailing List
Hi Hans,
On Thursday 29 April 2010 08:44:29 Hans Verkuil wrote:
> On Thursday 29 April 2010 05:42:39 Frederic Weisbecker wrote:
> > Hi,
> >
> > Linus suggested to rename struct v4l2_file_operations::ioctl
> > into bkl_ioctl to eventually get something greppable and make
> > its background explicit.
> >
> > While at it I thought it could be a good idea to just pushdown
> > the bkl to every v4l drivers that have an .ioctl, so that we
> > actually remove struct v4l2_file_operations::ioctl for good.
> >
> > It passed make allyesconfig on sparc.
> > Please tell me what you think.
>
> I much prefer to keep the bkl inside the v4l2 core. One reason is that I
> think that we can replace the bkl in the core with a mutex. Still not
> ideal of course, so the next step will be to implement proper locking in
> each driver. For this some additional v4l infrastructure work needs to be
> done. I couldn't proceed with that until the v4l events API patches went
> in, and that happened yesterday.
>
> So from my point of view the timeline is this:
>
> 1) I do the infrastructure work this weekend. This will make it much easier
> to convert drivers to do proper locking. And it will also simplify
> v4l2_priority handling, so I'm killing two birds with one stone :-)
>
> 2) Wait until Arnd's patch gets merged that pushes the bkl down to
> v4l2-dev.c
>
> 3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
> global mutex. Those drivers that call the bkl themselves should probably be
> converted to do proper locking, but there are only about 14 drivers that do
> this. The other 60 or so drivers should work fine if a v4l2-dev global lock
> is used. At this point the bkl is effectively removed from the v4l
> subsystem.
>
> 4) Work on the remaining 60 drivers to do proper locking and get rid of the
> v4l2-dev global lock. This is probably less work than it sounds.
>
> Since your patch moves everything down to the driver level it will actually
> make this work harder rather than easier. And it touches almost all drivers
> as well.
Every driver will need to be carefully checked to make sure the BKL can be
replaced by a v4l2-dev global mutex. Why would it be more difficult to do so
if the BKL is pushed down to the drivers ?
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-04-29 7:10 ` Laurent Pinchart
@ 2010-04-29 7:38 ` Arnd Bergmann
2010-05-01 9:55 ` Hans Verkuil
1 sibling, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2010-04-29 7:38 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Hans Verkuil, Frederic Weisbecker, LKML, John Kacur,
Linus Torvalds, Jan Blunck, Thomas Gleixner,
Mauro Carvalho Chehab, Greg KH, Linux Media Mailing List
On Thursday 29 April 2010 09:10:42 Laurent Pinchart wrote:
> On Thursday 29 April 2010 08:44:29 Hans Verkuil wrote:
> >
> > 3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
> > global mutex. Those drivers that call the bkl themselves should probably be
> > converted to do proper locking, but there are only about 14 drivers that do
> > this. The other 60 or so drivers should work fine if a v4l2-dev global lock
> > is used. At this point the bkl is effectively removed from the v4l
> > subsystem.
> >
> > 4) Work on the remaining 60 drivers to do proper locking and get rid of the
> > v4l2-dev global lock. This is probably less work than it sounds.
> >
> > Since your patch moves everything down to the driver level it will actually
> > make this work harder rather than easier. And it touches almost all drivers
> > as well.
>
> Every driver will need to be carefully checked to make sure the BKL can be
> replaced by a v4l2-dev global mutex. Why would it be more difficult to do so
> if the BKL is pushed down to the drivers ?
Note that you can completely skip the step of a v4l2-dev global mutex with
Frederic's patch. This is the only use of the BKL in the common v4l2
code as far as I can tell, so instead of introducing yet another global
lock, you can go straight to stage 4 and look at each driver separately,
possibly introducing a per driver lock.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-04-29 7:10 ` Laurent Pinchart
2010-04-29 7:38 ` Arnd Bergmann
@ 2010-05-01 9:55 ` Hans Verkuil
2010-05-01 10:47 ` Arnd Bergmann
2010-05-01 14:58 ` Frederic Weisbecker
1 sibling, 2 replies; 12+ messages in thread
From: Hans Verkuil @ 2010-05-01 9:55 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Frederic Weisbecker, LKML, Arnd Bergmann, John Kacur,
Linus Torvalds, Jan Blunck, Thomas Gleixner,
Mauro Carvalho Chehab, Greg KH, Linux Media Mailing List
On Thursday 29 April 2010 09:10:42 Laurent Pinchart wrote:
> Hi Hans,
>
> On Thursday 29 April 2010 08:44:29 Hans Verkuil wrote:
> > On Thursday 29 April 2010 05:42:39 Frederic Weisbecker wrote:
> > > Hi,
> > >
> > > Linus suggested to rename struct v4l2_file_operations::ioctl
> > > into bkl_ioctl to eventually get something greppable and make
> > > its background explicit.
> > >
> > > While at it I thought it could be a good idea to just pushdown
> > > the bkl to every v4l drivers that have an .ioctl, so that we
> > > actually remove struct v4l2_file_operations::ioctl for good.
> > >
> > > It passed make allyesconfig on sparc.
> > > Please tell me what you think.
> >
> > I much prefer to keep the bkl inside the v4l2 core. One reason is that I
> > think that we can replace the bkl in the core with a mutex. Still not
> > ideal of course, so the next step will be to implement proper locking in
> > each driver. For this some additional v4l infrastructure work needs to be
> > done. I couldn't proceed with that until the v4l events API patches went
> > in, and that happened yesterday.
> >
> > So from my point of view the timeline is this:
> >
> > 1) I do the infrastructure work this weekend. This will make it much easier
> > to convert drivers to do proper locking. And it will also simplify
> > v4l2_priority handling, so I'm killing two birds with one stone :-)
> >
> > 2) Wait until Arnd's patch gets merged that pushes the bkl down to
> > v4l2-dev.c
> >
> > 3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
> > global mutex. Those drivers that call the bkl themselves should probably be
> > converted to do proper locking, but there are only about 14 drivers that do
> > this. The other 60 or so drivers should work fine if a v4l2-dev global lock
> > is used. At this point the bkl is effectively removed from the v4l
> > subsystem.
> >
> > 4) Work on the remaining 60 drivers to do proper locking and get rid of the
> > v4l2-dev global lock. This is probably less work than it sounds.
> >
> > Since your patch moves everything down to the driver level it will actually
> > make this work harder rather than easier. And it touches almost all drivers
> > as well.
>
> Every driver will need to be carefully checked to make sure the BKL can be
> replaced by a v4l2-dev global mutex. Why would it be more difficult to do so
> if the BKL is pushed down to the drivers ?
The main reason is really that pushing the bkl into the v4l core makes it
easier to review. I noticed for example that this patch series forgot to change
the video_ioctl2 call in ivtv-ioctl.c to video_ioctl2_unlocked. And there may
be other places as well that were missed. Having so many drivers changed also
means a lot of careful reviewing.
But I will not block this change. However, I do think it would be better to
create a video_ioctl2_bkl rather than add a video_ioctl2_unlocked. The current
video_ioctl2 function *is* already unlocked. So you are subtle changing the
behavior of video_ioctl2. Not a good idea IMHO. And yes, grepping for
video_ioctl2_bkl is also easy to do and makes it more obvious that the BKL is
used in drivers that call this.
Regards,
Hans
--
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-05-01 9:55 ` Hans Verkuil
@ 2010-05-01 10:47 ` Arnd Bergmann
2010-05-01 14:58 ` Frederic Weisbecker
1 sibling, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2010-05-01 10:47 UTC (permalink / raw)
To: Hans Verkuil
Cc: Laurent Pinchart, Frederic Weisbecker, LKML, John Kacur,
Linus Torvalds, Jan Blunck, Thomas Gleixner,
Mauro Carvalho Chehab, Greg KH, Linux Media Mailing List
On Saturday 01 May 2010 11:55:37 Hans Verkuil wrote:
> However, I do think it would be better to
> create a video_ioctl2_bkl rather than add a video_ioctl2_unlocked. The current
> video_ioctl2 function is already unlocked. So you are subtle changing the
> behavior of video_ioctl2. Not a good idea IMHO. And yes, grepping for
> video_ioctl2_bkl is also easy to do and makes it more obvious that the BKL is
> used in drivers that call this.
Yes, that makes sense. It also allows working towards a goal of 'removing
video_ioctl2_bkl', which is easier to understand than 'converting video_ioctl2
users to video_ioctl2_unlocked and later renaming that'.
Arnd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-04-29 6:44 ` Hans Verkuil
2010-04-29 7:10 ` Laurent Pinchart
@ 2010-05-01 11:11 ` Alan Cox
1 sibling, 0 replies; 12+ messages in thread
From: Alan Cox @ 2010-05-01 11:11 UTC (permalink / raw)
To: Hans Verkuil
Cc: Frederic Weisbecker, LKML, Laurent Pinchart, Arnd Bergmann,
John Kacur, Linus Torvalds, Jan Blunck, Thomas Gleixner,
Mauro Carvalho Chehab, Greg KH, Linux Media Mailing List
> I much prefer to keep the bkl inside the v4l2 core. One reason is that I
> think that we can replace the bkl in the core with a mutex. Still not
> ideal of course, so the next step will be to implement proper locking in
I did look at this a long time ago - it doesn't really work becaue the
mutex you propose then has to be dropped and taken in the sleeping parts
of each ioctl to avoid app problems and in some cases threaded apps
deadlocking.
I think Arnd is right on his approach to this, having tried the other way.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/5] Pushdown bkl from v4l ioctls
2010-05-01 9:55 ` Hans Verkuil
2010-05-01 10:47 ` Arnd Bergmann
@ 2010-05-01 14:58 ` Frederic Weisbecker
1 sibling, 0 replies; 12+ messages in thread
From: Frederic Weisbecker @ 2010-05-01 14:58 UTC (permalink / raw)
To: Hans Verkuil
Cc: Laurent Pinchart, LKML, Arnd Bergmann, John Kacur, Linus Torvalds,
Jan Blunck, Thomas Gleixner, Mauro Carvalho Chehab, Greg KH,
Linux Media Mailing List
On Sat, May 01, 2010 at 11:55:37AM +0200, Hans Verkuil wrote:
> On Thursday 29 April 2010 09:10:42 Laurent Pinchart wrote:
> > Hi Hans,
> >
> > On Thursday 29 April 2010 08:44:29 Hans Verkuil wrote:
> > > On Thursday 29 April 2010 05:42:39 Frederic Weisbecker wrote:
> > > > Hi,
> > > >
> > > > Linus suggested to rename struct v4l2_file_operations::ioctl
> > > > into bkl_ioctl to eventually get something greppable and make
> > > > its background explicit.
> > > >
> > > > While at it I thought it could be a good idea to just pushdown
> > > > the bkl to every v4l drivers that have an .ioctl, so that we
> > > > actually remove struct v4l2_file_operations::ioctl for good.
> > > >
> > > > It passed make allyesconfig on sparc.
> > > > Please tell me what you think.
> > >
> > > I much prefer to keep the bkl inside the v4l2 core. One reason is that I
> > > think that we can replace the bkl in the core with a mutex. Still not
> > > ideal of course, so the next step will be to implement proper locking in
> > > each driver. For this some additional v4l infrastructure work needs to be
> > > done. I couldn't proceed with that until the v4l events API patches went
> > > in, and that happened yesterday.
> > >
> > > So from my point of view the timeline is this:
> > >
> > > 1) I do the infrastructure work this weekend. This will make it much easier
> > > to convert drivers to do proper locking. And it will also simplify
> > > v4l2_priority handling, so I'm killing two birds with one stone :-)
> > >
> > > 2) Wait until Arnd's patch gets merged that pushes the bkl down to
> > > v4l2-dev.c
> > >
> > > 3) Investigate what needs to be done to replace the bkl with a v4l2-dev.c
> > > global mutex. Those drivers that call the bkl themselves should probably be
> > > converted to do proper locking, but there are only about 14 drivers that do
> > > this. The other 60 or so drivers should work fine if a v4l2-dev global lock
> > > is used. At this point the bkl is effectively removed from the v4l
> > > subsystem.
> > >
> > > 4) Work on the remaining 60 drivers to do proper locking and get rid of the
> > > v4l2-dev global lock. This is probably less work than it sounds.
> > >
> > > Since your patch moves everything down to the driver level it will actually
> > > make this work harder rather than easier. And it touches almost all drivers
> > > as well.
> >
> > Every driver will need to be carefully checked to make sure the BKL can be
> > replaced by a v4l2-dev global mutex. Why would it be more difficult to do so
> > if the BKL is pushed down to the drivers ?
>
> The main reason is really that pushing the bkl into the v4l core makes it
> easier to review. I noticed for example that this patch series forgot to change
> the video_ioctl2 call in ivtv-ioctl.c to video_ioctl2_unlocked. And there may
> be other places as well that were missed. Having so many drivers changed also
> means a lot of careful reviewing.
Indeed, that's because I did it in a half automated way and my script
didn't took the direct calls to video_ioctl2() into account, so I had
to check them manually and probably missed a few, I will fix this one and
double check.
>
> But I will not block this change. However, I do think it would be better to
> create a video_ioctl2_bkl rather than add a video_ioctl2_unlocked. The current
> video_ioctl2 function *is* already unlocked. So you are subtle changing the
> behavior of video_ioctl2. Not a good idea IMHO. And yes, grepping for
> video_ioctl2_bkl is also easy to do and makes it more obvious that the BKL is
> used in drivers that call this.
Totally agreed, will respin with this rename.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2010-05-01 16:53 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <alpine.LFD.2.00.1004280750330.3739@i5.linux-foundation.org>
2010-04-29 3:42 ` [PATCH 0/5] Pushdown bkl from v4l ioctls Frederic Weisbecker
2010-04-29 6:44 ` Hans Verkuil
2010-04-29 7:10 ` Laurent Pinchart
2010-04-29 7:38 ` Arnd Bergmann
2010-05-01 9:55 ` Hans Verkuil
2010-05-01 10:47 ` Arnd Bergmann
2010-05-01 14:58 ` Frederic Weisbecker
2010-05-01 11:11 ` Alan Cox
2010-04-29 3:42 ` [PATCH 1/5] v4l: Pushdown bkl into video_ioctl2 Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 2/5] v4l: Use video_ioctl2_unlocked from drivers that don't want the bkl Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 3/5] v4l: Change users of video_ioctl2 to use unlocked_ioctl Frederic Weisbecker
2010-04-29 3:42 ` [PATCH 4/5] v4l: Pushdown bkl to drivers that implement their own ioctl Frederic Weisbecker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox