From patchwork Thu Jul 11 09:06:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826119 Return-Path: X-Original-To: patchwork-linux-media@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 A0705C0AB2 for ; Thu, 11 Jul 2013 09:13:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E7EE5200E0 for ; Thu, 11 Jul 2013 09:13:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 83A8820121 for ; Thu, 11 Jul 2013 09:13:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932655Ab3GKJM6 (ORCPT ); Thu, 11 Jul 2013 05:12:58 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:57375 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932611Ab3GKJMy (ORCPT ); Thu, 11 Jul 2013 05:12:54 -0400 Received: by mail-pa0-f52.google.com with SMTP id kq13so7617278pab.25 for ; Thu, 11 Jul 2013 02:12:53 -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=AwCjP+t5xiXK67fLIO8b7NWtrgd18VoLwYtat0DO1nk=; b=NBzgN8+aAB4L395yq1X2RZVhlsRXpXThczgEGMxskaEBclds5O6oUWuU1feJJJ9qq5 etNRYlccn3yiXJU9DPOgen+xxYZyYQAy/fqL0vDmzpVYBd5am/bdAiRUrUOZMxCEOm+v 0Sy3E9nSbr4iYqvViA+YX0CE6tqQ3Zfd0tLlfDXrtG12fzs/t+yV6is2zacGNGqKoXp2 gsuzg6pLnidYd7+ohioVNsH7SjmzLhCheV2udOjUTxb+BlmVew6EMm2yqxeA7Ik0m3X5 vrVa4Y6VgTf/bApE3JqJCrTLjZZkoq6j5Gt4cihsdn0a1MlZF3oe7mQIv02NwMzrLr3S rpXw== X-Received: by 10.66.231.103 with SMTP id tf7mr37734696pac.154.1373533973468; Thu, 11 Jul 2013 02:12:53 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id pv5sm36277871pac.14.2013.07.11.02.12.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:12:52 -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 , devel@driverdev.osuosl.org Subject: [PATCH 47/50] staging: btmtk_usb: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:06:10 +0800 Message-Id: <1373533573-12272-48-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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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=ham 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: devel@driverdev.osuosl.org Signed-off-by: Ming Lei --- drivers/staging/btmtk_usb/btmtk_usb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c index 0e783e8..ea10d4f 100644 --- a/drivers/staging/btmtk_usb/btmtk_usb.c +++ b/drivers/staging/btmtk_usb/btmtk_usb.c @@ -1218,6 +1218,7 @@ static void btmtk_usb_tx_complete(struct urb *urb) struct sk_buff *skb = urb->context; struct hci_dev *hdev = (struct hci_dev *)skb->dev; struct btmtk_usb_data *data = hci_get_drvdata(hdev); + unsigned long flags; BT_DBG("%s: %s urb %p status %d count %d\n", __func__, hdev->name, urb, urb->status, urb->actual_length); @@ -1231,9 +1232,9 @@ static void btmtk_usb_tx_complete(struct urb *urb) hdev->stat.err_tx++; done: - spin_lock(&data->txlock); + spin_lock_irqsave(&data->txlock, flags); data->tx_in_flight--; - spin_unlock(&data->txlock); + spin_unlock_irqrestore(&data->txlock, flags); kfree(urb->setup_packet);