From patchwork Sat Aug 17 16:25:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2846005 Return-Path: X-Original-To: patchwork-linux-wireless@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 6EB569F2F5 for ; Sat, 17 Aug 2013 16:31:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 921B7201E9 for ; Sat, 17 Aug 2013 16:31:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9E3B201DA for ; Sat, 17 Aug 2013 16:31:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482Ab3HQQbO (ORCPT ); Sat, 17 Aug 2013 12:31:14 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:64528 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753987Ab3HQQbN (ORCPT ); Sat, 17 Aug 2013 12:31:13 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so3215037pbb.19 for ; Sat, 17 Aug 2013 09:31:12 -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=+C7EJLP5UBiiwrOJOtmFlwNqDEh08zzgANnN3wAYMys=; b=SUNeusXviVK29+nvAMPBoINJMx6KA4wLxj5VPJS9dMBd9zhXfIP4IKkG5hsVdp66s3 z08+tZ1DT0oL/36yyhkSVHa2ZxIL1Xiop+Jy6oDu5aNrUp8ZZ7yfxfosPSXbHePoTMhz gfC9ttQ1W1wRLg5PPCPiHjDd1bJpKxDGKVx1hLWlRCQVxx02pZdNxkEg02fSVNBvsFtf tZYmRI+6WbpgrJG6YzPS8zuLOrgmIPL2SJS96igq4tWDSNG/dI+vpV5k71kdufGUiBkF Eolr06Hzo2jxDHLctxlzQy2mag5SzGzNqsz3dRocdRrOVGHKT5GDWzUs5JunT5ieXaH8 YAkw== X-Received: by 10.68.189.228 with SMTP id gl4mr3778439pbc.57.1376757072601; Sat, 17 Aug 2013 09:31:12 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id s5sm4533677pbo.38.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:31:11 -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 36/49] wireless: libertas_tf: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:25:01 +0800 Message-Id: <1376756714-25479-37-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_tf/if_usb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index d576dd6..0e9e972 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c @@ -610,6 +610,8 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, struct if_usb_card *cardp, struct lbtf_private *priv) { + unsigned long flags; + if (recvlength > LBS_CMD_BUFFER_SIZE) { lbtf_deb_usbd(&cardp->udev->dev, "The receive buffer is too large\n"); @@ -619,12 +621,12 @@ 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); memcpy(priv->cmd_resp_buff, recvbuff + MESSAGE_HEADER_LEN, recvlength - MESSAGE_HEADER_LEN); kfree_skb(skb); lbtf_cmd_response_rx(priv); - spin_unlock(&priv->driver_lock); + spin_unlock_irqrestore(&priv->driver_lock, flags); } /**