From patchwork Sat Aug 17 16:24:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2846003 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 6A9E3BF546 for ; Sat, 17 Aug 2013 16:31:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 878F220115 for ; Sat, 17 Aug 2013 16:30:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 712B0200F0 for ; Sat, 17 Aug 2013 16:30:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754428Ab3HQQax (ORCPT ); Sat, 17 Aug 2013 12:30:53 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:47245 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754018Ab3HQQaw (ORCPT ); Sat, 17 Aug 2013 12:30:52 -0400 Received: by mail-pb0-f46.google.com with SMTP id rq2so3214838pbb.19 for ; Sat, 17 Aug 2013 09:30:52 -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=R+YOIor9GinKuaSPA8wz3TCLrge58mIMWcJYbplz49s=; b=ZHsop0u6QM67xP/ewtMztnuP0zm9Qis3ACHR2RnJe8l3fD8yNUuHIMtKmCWHDcyLzX W0dbLN2nq19jK4Zr6DCXC4Tv2paSaPgRI2QCpFxpyEhvCSXtxaaOZnRSY6d2Nk4HzqFK GBdTfnsZPIki693n9KQ+DtanoEP4F6lB4wjIUqFfdkb08axoyo6V8+YqFC2KwaEH7WoR 2pK1iM4Kz0FbRQ9SFVksm/QJni1SA40+rdec/9RpTYEXj4ITk3b6MilRA2QSm03cBarF n/xyDKLi6q82+JuSRaraIqf+WNgHktUybas7NDLBgTpQcJjLiqX31gbHYrEu2lysmCUH Draw== X-Received: by 10.67.3.34 with SMTP id bt2mr3766423pad.3.1376757052144; Sat, 17 Aug 2013 09:30:52 -0700 (PDT) Received: from localhost ([183.37.213.217]) by mx.google.com with ESMTPSA id w6sm4536939pbt.32.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 17 Aug 2013 09:30:51 -0700 (PDT) From: Ming Lei To: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, Oliver Neukum , Alan Stern , Ming Lei , Christian Lamparter , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v1 34/49] wireless: ath: carl9170: prepare for enabling irq in complete() Date: Sun, 18 Aug 2013 00:24:59 +0800 Message-Id: <1376756714-25479-35-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: Christian Lamparter Cc: "John W. Linville" Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Ming Lei --- drivers/net/wireless/ath/carl9170/rx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c index 4684dd9..61f62a6 100644 --- a/drivers/net/wireless/ath/carl9170/rx.c +++ b/drivers/net/wireless/ath/carl9170/rx.c @@ -129,6 +129,7 @@ static int carl9170_check_sequence(struct ar9170 *ar, unsigned int seq) static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) { + unsigned long flags; /* * Some commands may have a variable response length * and we cannot predict the correct length in advance. @@ -148,7 +149,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) carl9170_restart(ar, CARL9170_RR_INVALID_RSP); } - spin_lock(&ar->cmd_lock); + spin_lock_irqsave(&ar->cmd_lock, flags); if (ar->readbuf) { if (len >= 4) memcpy(ar->readbuf, buffer + 4, len - 4); @@ -156,7 +157,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) ar->readbuf = NULL; } complete(&ar->cmd_wait); - spin_unlock(&ar->cmd_lock); + spin_unlock_irqrestore(&ar->cmd_lock, flags); } void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len)