From patchwork Sat Aug 17 16:25:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2846004 Return-Path: X-Original-To: patchwork-linux-wireless@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 77755BF546 for ; Sat, 17 Aug 2013 16:31:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9D812201E9 for ; Sat, 17 Aug 2013 16:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C3365201DA for ; Sat, 17 Aug 2013 16:31:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754471Ab3HQQbE (ORCPT ); Sat, 17 Aug 2013 12:31:04 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:46501 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754459Ab3HQQbC (ORCPT ); Sat, 17 Aug 2013 12:31:02 -0400 Received: by mail-pb0-f41.google.com with SMTP id rp2so3224398pbb.14 for ; Sat, 17 Aug 2013 09:31: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:in-reply-to:references; bh=K8zBUqyUhuNpIfT75sKVYcuVlVYTL+6PgOtpl2fqFaU=; b=cvsfw+Fze7F+ajTSV5MPUW+XFHfPrUXF3i8lvrCqRNH6udcC6qSPOdyPLZuvCGIaRi bkOE2ydc4mb4HwG6h4Q9ojr85yx82hiIFLJVgJJISq2Vv05KSqC1+6+YONyvz6ZUiWna iH7X5nBMgRMGtd7I5l6XDY6hoMO3ZUta7JeDBajMLsQaraovX3zkgqPIzIAzSfhrUHTe 7LRNnKD4MXpslqFpk5xjBLATaIqsOpyB3y2mMM1kJerjOU15q3bx32ZTg0ZW8pX0CWpk fcbQasJArWbtRmM4mc5UeIG5jzB75h7w1pOekGqPfCpKxWBtK/lEuDNMX/pPgQ9jahT1 rvQw== X-Received: by 10.68.162.36 with SMTP id xx4mr3695527pbb.47.1376757061908; Sat, 17 Aug 2013 09:31:01 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id xe9sm4548626pbc.21.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:31:01 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , Ming Lei , "John W. Linville" , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v1 35/49] wireless: libertas: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:25:00 +0800 Message-Id: <1376756714-25479-36-git-send-email-ming.lei@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1376756714-25479-1-git-send-email-ming.lei@canonical.com> References: <1376756714-25479-1-git-send-email-ming.lei@canonical.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.6 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: "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");