From patchwork Fri Mar 20 18:08:49 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alessio Igor Bogani X-Patchwork-Id: 13358 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 n2KI8qpu022009 for ; Fri, 20 Mar 2009 18:08:53 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751981AbZCTSIx (ORCPT ); Fri, 20 Mar 2009 14:08:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752732AbZCTSIx (ORCPT ); Fri, 20 Mar 2009 14:08:53 -0400 Received: from mail-fx0-f158.google.com ([209.85.220.158]:63277 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981AbZCTSIw convert rfc822-to-8bit (ORCPT ); Fri, 20 Mar 2009 14:08:52 -0400 Received: by fxm2 with SMTP id 2so1013043fxm.37 for ; Fri, 20 Mar 2009 11:08:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type:content-transfer-encoding; bh=5eBoFiO8s+M9snUNsaA3OFG/Zb/Ovgoql/AV2W9b/Qw=; b=Z0BVqWlHOjQ2kvTcGjm5UY992c5GU/nLxIg5kRtqoj8B3/RUvgy8agp2acy0FDeNRK 9nSwusvYbeun69nRw+amKqYpAxh0313syDt0C77PJAWFhz3NIlRfih0oLyavzZ28d8yt sekY5TM3vUEYaK0mJCEWkx+t6fGJ+Uk4i8fWY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=jj6EvtWXXm9YdmupGZIx+Xxs+J7xnq/eX9k/jlyctthRwMQrXSnz/5R4aDRdCn8O78 ytmKHuvpq6d0lhvSzfZU0jaEAVsmg+zeiJfw51lONnln5rm9gC/nsJ5A8GU07o4Sy3i1 icJ2LZYsBXsMMv1Ma1FkyEKeU3ebXpwm2xunI= MIME-Version: 1.0 Received: by 10.204.117.203 with SMTP id s11mr1328737bkq.153.1237572529265; Fri, 20 Mar 2009 11:08:49 -0700 (PDT) In-Reply-To: <1237572165-6494-1-git-send-email-abogani@texware.it> References: <1237572165-6494-1-git-send-email-abogani@texware.it> Date: Fri, 20 Mar 2009 19:08:49 +0100 X-Google-Sender-Auth: ed76882ce856f018 Message-ID: <63a49ef40903201108u38cb2956pbb0c3e2f9806d406@mail.gmail.com> Subject: Fwd: [PATCH] sony-laptop: Kill the BKL From: Alessio Igor Bogani To: malattia@linux.it, linux-acpi@vger.kernel.org Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org ---------- Forwarded message ---------- From: Alessio Igor Bogani Date: 2009/3/20 Subject: [PATCH] sony-laptop: Kill the BKL To: LKML Cc: Alessio Igor Bogani Signed-off-by: Alessio Igor Bogani ---  drivers/platform/x86/sony-laptop.c |   12 ++++++++----  1 files changed, 8 insertions(+), 4 deletions(-) -- 1.6.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 537959d..15f940b 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 @@ -1934,10 +1933,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;  }