From patchwork Thu Jul 11 09:05:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826174 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DD0A9C0AB2 for ; Thu, 11 Jul 2013 09:16:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B007220107 for ; Thu, 11 Jul 2013 09:16:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 846C620121 for ; Thu, 11 Jul 2013 09:16:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932289Ab3GKJJx (ORCPT ); Thu, 11 Jul 2013 05:09:53 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:48258 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJJv (ORCPT ); Thu, 11 Jul 2013 05:09:51 -0400 Received: by mail-pa0-f49.google.com with SMTP id ld11so7606108pab.36 for ; Thu, 11 Jul 2013 02:09:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=P2UtbIbnv49qJYUCqaOFTTpgholBnkzIPPw+PsVXPI0=; b=JEP5UroBGlm8odYQEfNAGPYLXso3S4jGk4poW7o0u3vMUawMTwwnrw5Vzd3bsG3Iiw QCWMqkHOUBK70HFFWaITOpUg2Yb0gBHmDqrru7RAuV8KYRBcPI073Prd8vY9IMEx4OCy XbBLbZq1LK9c0fjlcHl1NwrU1jM1NzhA0X8NGVsAve7HVZi7bCS+BAyoPWdJNNSeih7o LzocWAPldwH3XPgSwG/3CRP25xUFUGR/wan0KKTZ2fVoj2lSFtiHtsh/5/kSxezbkeXY +fC6T05MTPiXKdQg9l3lHXoGgLKTmBdfvBLMEdSIjgYMBLaUw1yaTJX6Lsl5tI/GoUaV iJDw== X-Received: by 10.66.224.237 with SMTP id rf13mr37670181pac.26.1373533790342; Thu, 11 Jul 2013 02:09:50 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id ep4sm11083385pbd.35.2013.07.11.02.09.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:49 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , linux-input@vger.kernel.org, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-media@vger.kernel.org, alsa-devel@alsa-project.org, Ming Lei , Dmitry Torokhov Subject: [PATCH 24/50] input: cm109: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:47 +0800 Message-Id: <1373533573-12272-25-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> References: <1373533573-12272-1-git-send-email-ming.lei@canonical.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Dmitry Torokhov Cc: linux-input@vger.kernel.org Signed-off-by: Ming Lei --- drivers/input/misc/cm109.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 082684e..cac4e37 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -340,6 +340,7 @@ static void cm109_urb_irq_callback(struct urb *urb) struct cm109_dev *dev = urb->context; const int status = urb->status; int error; + unsigned long flags; dev_dbg(&dev->intf->dev, "### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n", dev->irq_data->byte[0], @@ -379,7 +380,7 @@ static void cm109_urb_irq_callback(struct urb *urb) out: - spin_lock(&dev->ctl_submit_lock); + spin_lock_irqsave(&dev->ctl_submit_lock, flags); dev->irq_urb_pending = 0; @@ -403,7 +404,7 @@ static void cm109_urb_irq_callback(struct urb *urb) __func__, error); } - spin_unlock(&dev->ctl_submit_lock); + spin_unlock_irqrestore(&dev->ctl_submit_lock, flags); } static void cm109_urb_ctl_callback(struct urb *urb) @@ -411,6 +412,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) struct cm109_dev *dev = urb->context; const int status = urb->status; int error; + unsigned long flags; dev_dbg(&dev->intf->dev, "### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n", dev->ctl_data->byte[0], @@ -421,7 +423,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) if (status) dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status); - spin_lock(&dev->ctl_submit_lock); + spin_lock_irqsave(&dev->ctl_submit_lock, flags); dev->ctl_urb_pending = 0; @@ -442,7 +444,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) } } - spin_unlock(&dev->ctl_submit_lock); + spin_unlock_irqrestore(&dev->ctl_submit_lock, flags); } static void cm109_toggle_buzzer_async(struct cm109_dev *dev)