From patchwork Thu Jul 11 09:05:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826106 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 F0C4A9F756 for ; Thu, 11 Jul 2013 09:11:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C411F20107 for ; Thu, 11 Jul 2013 09:11:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9EAE6200E0 for ; Thu, 11 Jul 2013 09:11:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932462Ab3GKJLN (ORCPT ); Thu, 11 Jul 2013 05:11:13 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:57001 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJLL (ORCPT ); Thu, 11 Jul 2013 05:11:11 -0400 Received: by mail-pa0-f41.google.com with SMTP id bj3so7693168pad.14 for ; Thu, 11 Jul 2013 02:11:10 -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=+C7EJLP5UBiiwrOJOtmFlwNqDEh08zzgANnN3wAYMys=; b=Qy6PDDI2g1Wo8U71N1L1YGoYBYdAu+WIzbna45f9XC3HfBu39UhybCN6OwnadJ/y+B ECmo0qR+NwG7ELzVhWjYcTHivSxRLuVcjm7zNapfsEA9rgikrndUVNqxA5D86t+8YC29 x6cI6uL0L2lqHBJJH+YsTorUlbeqIi4Sw/a2dh/ZRfjRUyrv9mFBqniAh9llgWHPJn2b rVJ2+5ODv/D/Tq2EIxtZ7NoiLaJ2J8+U5q2mk2xE47jWV2cGt7KUAwNXHGy18R6C2V0L NkuWJ0SGqEp6bIF76SpED1xGAeqMTHsuwU/DfyucJpgnp3Nj7UuJ+LmeW2c2e8CjlXvw anNg== X-Received: by 10.68.113.2 with SMTP id iu2mr35722673pbb.108.1373533870007; Thu, 11 Jul 2013 02:11:10 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id it7sm6716814pbc.25.2013.07.11.02.11.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:11:09 -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 34/50] wireless: libertas_tf: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:57 +0800 Message-Id: <1373533573-12272-35-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: "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); } /**