From patchwork Thu Mar 26 12:58:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mattia Dongili X-Patchwork-Id: 14519 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2QCwTlK018718 for ; Thu, 26 Mar 2009 12:58:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757005AbZCZM6h (ORCPT ); Thu, 26 Mar 2009 08:58:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756984AbZCZM6h (ORCPT ); Thu, 26 Mar 2009 08:58:37 -0400 Received: from static-220-247-10-204.b-man.svips.gol.ne.jp ([220.247.10.204]:53419 "EHLO smtp.kamineko.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756511AbZCZM6a (ORCPT ); Thu, 26 Mar 2009 08:58:30 -0400 Received: from tadamune.kamineko.org (unknown [192.168.1.21]) by smtp.kamineko.org (Postfix) with ESMTP id 872F31905D; Thu, 26 Mar 2009 21:58:26 +0900 (JST) Received: by tadamune.kamineko.org (Postfix, from userid 1000) id 5FBA613139; Thu, 26 Mar 2009 21:58:26 +0900 (JST) From: Mattia Dongili To: Len Brown Cc: linux-acpi@vger.kernel.org, Alessio Igor Bogani , Mattia Dongili Subject: [PATCH 14/14] sony-laptop: Kill the BKL Date: Thu, 26 Mar 2009 21:58:25 +0900 Message-Id: <1238072305-8085-15-git-send-email-malattia@linux.it> X-Mailer: git-send-email 1.6.2 In-Reply-To: <1238072305-8085-14-git-send-email-malattia@linux.it> References: <1238072305-8085-1-git-send-email-malattia@linux.it> <1238072305-8085-2-git-send-email-malattia@linux.it> <1238072305-8085-3-git-send-email-malattia@linux.it> <1238072305-8085-4-git-send-email-malattia@linux.it> <1238072305-8085-5-git-send-email-malattia@linux.it> <1238072305-8085-6-git-send-email-malattia@linux.it> <1238072305-8085-7-git-send-email-malattia@linux.it> <1238072305-8085-8-git-send-email-malattia@linux.it> <1238072305-8085-9-git-send-email-malattia@linux.it> <1238072305-8085-10-git-send-email-malattia@linux.it> <1238072305-8085-11-git-send-email-malattia@linux.it> <1238072305-8085-12-git-send-email-malattia@linux.it> <1238072305-8085-13-git-send-email-malattia@linux.it> <1238072305-8085-14-git-send-email-malattia@linux.it> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org From: Alessio Igor Bogani Signed-off-by: Alessio Igor Bogani Signed-off-by: Mattia Dongili --- drivers/platform/x86/sony-laptop.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index fc0dd63..0f71031 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include #include @@ -2180,10 +2179,15 @@ static int sonypi_misc_release(struct inode *inode, struct file *file) static int sonypi_misc_open(struct inode *inode, struct file *file) { /* Flush input queue on first open */ - lock_kernel(); + unsigned long flags; + + spin_lock_irqsave(sonypi_compat.fifo->lock, flags); + if (atomic_inc_return(&sonypi_compat.open_count) == 1) - kfifo_reset(sonypi_compat.fifo); - unlock_kernel(); + __kfifo_reset(sonypi_compat.fifo); + + spin_unlock_irqrestore(sonypi_compat.fifo->lock, flags); + return 0; }