s2255drv: removal of big kernel lock
PATCH 1/1 s2255drv: removal of big kernel lock
# HG changeset patch
# User Dean Anderson <[email protected]>
# Date 1270046291 25200
# Node ID c72bdc8732abc0cf7bc376babfd06b2d999bdcf4 # Parent 2ab296deae938864b06b29cc224eb4b670ae3aa9
s2255drv: removal of BKL
From: Dean Anderson <[email protected]>
big kernel lock removed from open function.
v4l2 code does not require locking the open function except to check asynchronous firmware load state, which is protected by a mutex
Priority: normal
linux/drivers/media/video/s2255drv.c +1 -10
@@ -1753,7 +1753,6 @@int state;dprintk (1 ,"s2255: open called (dev=%s)\n" ,video_device_node_name (vdev)); -lock_kernel ();for (i =0 ; i <MAX_CHANNELS ; i++)if (&dev->vdev[i] == vdev) { cur_channel = i;
@@ -1769,7 +1768,6 @@switch (state) {case S2255_FW_DISCONNECTING :mutex_unlock (&dev->open_lock); -unlock_kernel ();return -ENODEV ;case S2255_FW_FAILED : s2255_dev_err(&dev->udev->dev,
@@ -1809,30 +1807,24 @@break ;case S2255_FW_FAILED :printk (KERN_INFO "2255 firmware load failed.\n" ); -unlock_kernel ();return -ENODEV ;case S2255_FW_DISCONNECTING :printk (KERN_INFO "%s: disconnecting\n" , __func__); -unlock_kernel ();return -ENODEV ;case S2255_FW_LOADED_DSPWAIT :case S2255_FW_NOTLOADED :printk (KERN_INFO "%s: firmware not loaded yet" "please try again later\n" , __func__); -unlock_kernel ();return -EAGAIN ;default :printk (KERN_INFO "%s: unknown state\n" , __func__); -unlock_kernel ();return -EFAULT ; }/* allocate + initialize per filehandle data */ fh =kzalloc (sizeof (*fh),GFP_KERNEL ); -if (NULL == fh) { -unlock_kernel (); +if (NULL == fh)return -ENOMEM ; - } file->private_data = fh; fh->dev = dev; fh->type =V4L2_BUF_TYPE_VIDEO_CAPTURE ;
@@ -1860,7 +1852,6 @@ fh->type,V4L2_FIELD_INTERLACED , sizeof(struct s2255_buffer), fh); -unlock_kernel ();return 0 ; }
Quoted 7 lines · On Wednesday 31 March 2010 16:41:51 Dean A. wrote:
# HG changeset patch
# User Dean Anderson <[email protected]>
# Date 1270046291 25200
# Node IDc72bdc8732abc0cf7bc376babfd06b2d999bdcf4# Parent2ab296deae938864b06b29cc224eb4b670ae3aa9
s2255drv: removal of BKL
Quoted 6 lines
From: Dean Anderson <[email protected]>
big kernel lock removed from open function.
v4l2 code does not require locking the open function except to check asynchronous firmware load state, which is protected by a mutex
Can you do the same for the go7007 driver?
And for both drivers you can also switch to using unlocked_ioctl.
Regards,
Hans
Signature · 1 line
Hans Verkuil - video4linux developer - sponsored by TANDBERG