From patchwork Thu Jul 11 09:05:45 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826184 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9735E9F756 for ; Thu, 11 Jul 2013 09:17:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE2B420107 for ; Thu, 11 Jul 2013 09:17:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BA0E5200D0 for ; Thu, 11 Jul 2013 09:17:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932303Ab3GKJJh (ORCPT ); Thu, 11 Jul 2013 05:09:37 -0400 Received: from mail-pd0-f178.google.com ([209.85.192.178]:45434 "EHLO mail-pd0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932245Ab3GKJJf (ORCPT ); Thu, 11 Jul 2013 05:09:35 -0400 Received: by mail-pd0-f178.google.com with SMTP id w11so7314042pde.37 for ; Thu, 11 Jul 2013 02:09:34 -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=UHKsDDVw/4Csl2j5tcX75oPMWvoE5OUip3hNZC/yhr8=; b=TyYrqSOExMkg8nF7OruRRPZEFHbcx4WT5TN0TvoejfZ7ZsrZuOdglwEyI2nx2lD/wq Szz/XLrYHVu7SnmpKP+q0qUbCjVVnwuUi7nvQ3bC3Zv1ajDxcLT2qjboSFAfCxlYhWYn 80vhoVojxs6dcFLjxpaW3WeAIjqJg5Y0JKLKg7aL6lJCr715y6IoyUxJ2XX1fzvAR/Er CcobNGe/BIu629g/90UlhykdQFJDRc0/0omkwHuReXQnB7JdwKp1Sxshntg3NCLnE4bF 1x+Go61i3P552XetCQHdLtvGOlTJat7hAEi5MeW3DZ3ZADDAKoes3NdVYNoTCu1qm5tm HRow== X-Received: by 10.68.107.98 with SMTP id hb2mr35335014pbb.99.1373533774017; Thu, 11 Jul 2013 02:09:34 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id zf3sm6412010pac.9.2013.07.11.02.09.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:09:32 -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 , Marcel Holtmann , Gustavo Padovan , Johan Hedberg Subject: [PATCH 22/50] BT: btusb: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:45 +0800 Message-Id: <1373533573-12272-23-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=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: Marcel Holtmann Cc: Gustavo Padovan Cc: Johan Hedberg Cc: linux-bluetooth@vger.kernel.org Signed-off-by: Ming Lei --- drivers/bluetooth/btusb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index ea63958..018b8b0 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -573,6 +573,7 @@ static void btusb_tx_complete(struct urb *urb) struct sk_buff *skb = urb->context; struct hci_dev *hdev = (struct hci_dev *) skb->dev; struct btusb_data *data = hci_get_drvdata(hdev); + unsigned long flags; BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb->status, urb->actual_length); @@ -586,9 +587,9 @@ static void btusb_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);