From patchwork Thu Jul 11 09:05:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826104 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 B7C219F756 for ; Thu, 11 Jul 2013 09:11:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A99E120107 for ; Thu, 11 Jul 2013 09:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BE95200E0 for ; Thu, 11 Jul 2013 09:11:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932449Ab3GKJLG (ORCPT ); Thu, 11 Jul 2013 05:11:06 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:40510 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJLC (ORCPT ); Thu, 11 Jul 2013 05:11:02 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc8so7646868pbc.4 for ; Thu, 11 Jul 2013 02:11:01 -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=K8zBUqyUhuNpIfT75sKVYcuVlVYTL+6PgOtpl2fqFaU=; b=laPnPgUIkNskMpZ8cL4X2cN8yygYVxyVFCdLucyHVSbQWaA3T3V7TDj4TJnmLK+Q1p UE0CslY+E18rhVkQLRwkz285Lg9JPiA3sFWOvfdFwvP8uk+CarVm+hcfaa0sTjnDQw7K NLODuS6YQLQeygpT9TQEAJ1YDEDv5NVBDlLOtcXIer2ZUvZMMDk8nMbFs2VBqSA4TkZj Zf+ED/rDxPYzZM4fz7XZ86eCyrxLhv6j3rJCVqtV4en7/3mgpTHsKd4ItHcGNID6sWxE 7HD3j18BljDHB4jBgjdLxL/tm/tczxqiLas8cCOdFblNd/kg0/OUFWiALqyUQ1vmO7Vx fkYA== X-Received: by 10.68.179.225 with SMTP id dj1mr35194514pbc.193.1373533861898; Thu, 11 Jul 2013 02:11:01 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id fl2sm41040798pab.23.2013.07.11.02.10.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:11:01 -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 , "John W. Linville" , libertas-dev@lists.infradead.org Subject: [PATCH 33/50] wireless: libertas: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:56 +0800 Message-Id: <1373533573-12272-34-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: "John W. Linville" Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Ming Lei --- drivers/net/wireless/libertas/if_usb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 2798077..f6a8396 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -626,6 +626,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, struct lbs_private *priv) { u8 i; + unsigned long flags; if (recvlength > LBS_CMD_BUFFER_SIZE) { lbs_deb_usbd(&cardp->udev->dev, @@ -636,7 +637,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, BUG_ON(!in_interrupt()); - spin_lock(&priv->driver_lock); + spin_lock_irqsave(&priv->driver_lock, flags); i = (priv->resp_idx == 0) ? 1 : 0; BUG_ON(priv->resp_len[i]); @@ -646,7 +647,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, kfree_skb(skb); lbs_notify_command_response(priv, i); - spin_unlock(&priv->driver_lock); + spin_unlock_irqrestore(&priv->driver_lock, flags); lbs_deb_usbd(&cardp->udev->dev, "Wake up main thread to handle cmd response\n");