From patchwork Thu Jul 11 09:05:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Lei X-Patchwork-Id: 2826158 Return-Path: X-Original-To: patchwork-linux-media@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 10F3FC0AB2 for ; Thu, 11 Jul 2013 09:15:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CAD6920107 for ; Thu, 11 Jul 2013 09:15:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2ED1D200D0 for ; Thu, 11 Jul 2013 09:15:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932435Ab3GKJK7 (ORCPT ); Thu, 11 Jul 2013 05:10:59 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:42834 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932278Ab3GKJKy (ORCPT ); Thu, 11 Jul 2013 05:10:54 -0400 Received: by mail-pd0-f170.google.com with SMTP id x11so7314312pdj.29 for ; Thu, 11 Jul 2013 02:10:54 -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=R+YOIor9GinKuaSPA8wz3TCLrge58mIMWcJYbplz49s=; b=iBhuXJ9d2e0Z5u2ZipRjQM84M0so11V3AdKJANSYJpdHhg51ANBkOukgv1LR5hTPIg 3KLeoYyWfif5mMAfFjfZ27rmAgivGjCz8cnN5au9qofMqQV0rLmjP/2OKAkBZSHSSEwD 2wXAi0II26qjZjEJNLj25sBz8Z9pPyH8n+XfadlwYoNSn+mrDitni/62d4r86jrkef+Q oy0Q0e0W+wun+Esz42vp6QLkidX1uB/FYWUuMeFlh94nV7JLLLgfIkOotBfmTSamOxm3 DVzcY14FhMf2nEwUoQN5GLK5fFZ3773rVR7g9K/u3ZnpNoUFXqHxTo/4cH2YQBmpHzQ6 RBLA== X-Received: by 10.66.121.170 with SMTP id ll10mr36701735pab.126.1373533853979; Thu, 11 Jul 2013 02:10:53 -0700 (PDT) Received: from localhost ([183.37.203.123]) by mx.google.com with ESMTPSA id wg6sm38677383pbc.3.2013.07.11.02.10.49 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 11 Jul 2013 02:10:53 -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 , Christian Lamparter , "John W. Linville" Subject: [PATCH 32/50] wireless: ath: carl9170: spin_lock in complete() cleanup Date: Thu, 11 Jul 2013 17:05:55 +0800 Message-Id: <1373533573-12272-33-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: 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)