Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit adfedd21 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

dvb/bt8xx: kill the big kernel lock



The bt8xx driver only uses the big kernel lock in its dst_ca_ioctl
function and never to serialize against other code, so we can
trivially replace it with a private mutex.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: linux-media@vger.kernel.org
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>
parent efbec1cd
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/string.h>
#include <linux/dvb/ca.h>
#include <linux/dvb/ca.h>
#include "dvbdev.h"
#include "dvbdev.h"
@@ -52,6 +52,7 @@
} while(0)
} while(0)




static DEFINE_MUTEX(dst_ca_mutex);
static unsigned int verbose = 5;
static unsigned int verbose = 5;
module_param(verbose, int, 0644);
module_param(verbose, int, 0644);
MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)");
MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)");
@@ -564,7 +565,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
	void __user *arg = (void __user *)ioctl_arg;
	void __user *arg = (void __user *)ioctl_arg;
	int result = 0;
	int result = 0;


	lock_kernel();
	mutex_lock(&dst_ca_mutex);
	dvbdev = file->private_data;
	dvbdev = file->private_data;
	state = (struct dst_state *)dvbdev->priv;
	state = (struct dst_state *)dvbdev->priv;
	p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL);
	p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL);
@@ -652,7 +653,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
	kfree (p_ca_slot_info);
	kfree (p_ca_slot_info);
	kfree (p_ca_caps);
	kfree (p_ca_caps);


	unlock_kernel();
	mutex_unlock(&dst_ca_mutex);
	return result;
	return result;
}
}