From patchwork Tue Sep 14 19:35:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 180312 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8EJZp2I004411 for ; Tue, 14 Sep 2010 19:35:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754934Ab0INTfj (ORCPT ); Tue, 14 Sep 2010 15:35:39 -0400 Received: from moutng.kundenserver.de ([212.227.17.8]:50798 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754880Ab0INTfi (ORCPT ); Tue, 14 Sep 2010 15:35:38 -0400 Received: from localhost.localdomain (port-92-200-37-189.dynamic.qsc.de [92.200.37.189]) by mrelayeu.kundenserver.de (node=mrbap0) with ESMTP (Nemesis) id 0Lnlst-1OMXix2eXH-00hl6e; Tue, 14 Sep 2010 21:35:36 +0200 From: Arnd Bergmann To: arnd@arndb.de Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab Subject: [PATCH 15/18] dvb/bt8xx: kill the big kernel lock Date: Tue, 14 Sep 2010 21:35:06 +0200 Message-Id: <1284492909-7147-16-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1284492909-7147-1-git-send-email-arnd@arndb.de> References: <1284492909-7147-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:eh7eQUgsCROEF0LVzqamMR6W6j9kZlp//aah/c2jIj8 nd/6+d/AC45dlZ8XFGQB4qctF2QUxCiYgCI7BPp0A6YFq/rG9k Aq6BUQDfFhZsfeOf/CxgVF+2kBmN9ighNL5p3ucT5kJ0Qsu3hn tmDE0VC/UG8/nfyxD1OjBsdpmHQjSs++bYrfAvzuCfjlhYg4gm kFdH6bNnrS/2zto53nJVg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Sep 2010 19:35:51 +0000 (UTC) diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c index cf87051..d75788b 100644 --- a/drivers/media/dvb/bt8xx/dst_ca.c +++ b/drivers/media/dvb/bt8xx/dst_ca.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include "dvbdev.h" @@ -52,6 +52,7 @@ } while(0) +static DEFINE_MUTEX(dst_ca_mutex); static unsigned int verbose = 5; module_param(verbose, int, 0644); 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; int result = 0; - lock_kernel(); + mutex_lock(&dst_ca_mutex); dvbdev = file->private_data; state = (struct dst_state *)dvbdev->priv; 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_caps); - unlock_kernel(); + mutex_unlock(&dst_ca_mutex); return result; }