From patchwork Mon Mar 9 13:19:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5967381 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D85DBF440 for ; Mon, 9 Mar 2015 13:21:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 619172024D for ; Mon, 9 Mar 2015 13:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 746542020F for ; Mon, 9 Mar 2015 13:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753416AbbCINVo (ORCPT ); Mon, 9 Mar 2015 09:21:44 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:42891 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753338AbbCINVm (ORCPT ); Mon, 9 Mar 2015 09:21:42 -0400 Received: by lbjb6 with SMTP id b6so35645333lbj.9 for ; Mon, 09 Mar 2015 06:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=FLfATuZHskrbhGGI/HLC4ruVALQ/2szH3NmiC8gMXtE=; b=R2ftW4L0BFF98oUtjB3BrSlf3vuZ1I0NTzCMicMTWnQOB4qQQfXXhhE1YXhLSrnbxv sY3iOY1UyY+ym/Axy9AzRoXR2oA1WLhvfPD0nID/21vNoYro7NWj79g7coNzHGpnXjrv gJYOufd2l44yh4n9gYgXRUCRxLuqDcWnB1BMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=FLfATuZHskrbhGGI/HLC4ruVALQ/2szH3NmiC8gMXtE=; b=eJmlCbkV+wfLX8V/5zQ1AhI3llF6eD6tRCxUYjunI/+p6tBrZgybQQ/BvYonlUBylL 74fgRgSGowFCq6CYW2j7y3qfcIh2ezMvUOFoIx8ZJ6mY1x+iJLeC7LU2pvQIgI4iiOLj EV4DxafYPSSyoWewHvDQiL24VFEc9lx2PqYPIfWyasehFV6PR/5+q5YOg2gjA5pGe5DM rFFBgSiOoF490WmXd1Ox6YOB31rSWVwfJSeIaV95BSGIt9Z3Y9Tqr3FCmeNzkuLlTsV+ o57DCuM0UEOEgVjWT8yzVj5lXdVx6EIgtxn4uwZfDTp+io/dSU4Cj/81mCwxC0hGmmG3 QGNQ== X-Gm-Message-State: ALoCoQniHvF3Uz+/T4y8olgv9b6LICdFlKv0nlGc4diJfhnuiagNkxsGAij4taGwnoIbt8+OEvF6fetCIPqe/QmcVSkpWeXyib7M9Z2FOK2qwT9sNEK9ovDZI94Ah6r7HfbulHFCAGoA X-Received: by 10.152.6.2 with SMTP id w2mr25555255law.6.1425907299970; Mon, 09 Mar 2015 06:21:39 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id uh8sm3459572lbc.3.2015.03.09.06.21.37 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Mar 2015 06:21:37 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: fix patching mistake for AP/IBSS CSA Date: Mon, 9 Mar 2015 14:19:24 +0100 Message-Id: <1425907164-13935-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <877fuqz7b6.fsf@kamboji.qca.qualcomm.com> References: <877fuqz7b6.fsf@kamboji.qca.qualcomm.com> X-DomainID: tieto.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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_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 Mistakenly v1 of `ath10k: fix AP/IBSS CSA with template based fw` (81a9a17db5d766d2872c4ab8a77b8666d22031ec) was applied. This patch applies the missing bits from v2: * remove unnecessary locking * add some (sanity) checks There are no practical functionality differences between v1 and v2. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 12 +++++++----- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 1138f4f..2f9518a 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1230,9 +1230,10 @@ static void ath10k_control_beaconing(struct ath10k_vif *arvif, if (!info->enable_beacon) { ath10k_vdev_stop(arvif); - spin_lock_bh(&arvif->ar->data_lock); arvif->is_started = false; arvif->is_up = false; + + spin_lock_bh(&arvif->ar->data_lock); ath10k_mac_vif_beacon_free(arvif); spin_unlock_bh(&arvif->ar->data_lock); @@ -1466,6 +1467,11 @@ static void ath10k_mac_vif_ap_csa_count_down(struct ath10k_vif *arvif) struct ieee80211_vif *vif = arvif->vif; int ret; + lockdep_assert_held(&arvif->ar->conf_mutex); + + if (WARN_ON(!test_bit(WMI_SERVICE_BEACON_OFFLOAD, ar->wmi.svc_map))) + return; + if (arvif->vdev_type != WMI_VDEV_TYPE_AP) return; @@ -2092,9 +2098,7 @@ static void ath10k_bss_assoc(struct ieee80211_hw *hw, return; } - spin_lock_bh(&arvif->ar->data_lock); arvif->is_up = true; - spin_unlock_bh(&arvif->ar->data_lock); /* Workaround: Some firmware revisions (tested with qca6174 * WLAN.RM.2.0-00073) have buggy powersave state machine and must be @@ -2136,9 +2140,7 @@ static void ath10k_bss_disassoc(struct ieee80211_hw *hw, return; } - spin_lock_bh(&arvif->ar->data_lock); arvif->is_up = false; - spin_unlock_bh(&arvif->ar->data_lock); } static int ath10k_station_assoc(struct ath10k *ar, diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 939d86b..2e12637 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -206,11 +206,9 @@ static int ath10k_wmi_tlv_event_bcn_tx_status(struct ath10k *ar, break; } - spin_lock_bh(&ar->data_lock); arvif = ath10k_get_arvif(ar, vdev_id); - if (arvif && arvif->is_up) + if (arvif && arvif->is_up && arvif->vif->csa_active) ieee80211_queue_work(ar->hw, &arvif->ap_csa_work); - spin_unlock_bh(&ar->data_lock); kfree(tb); return 0;