From patchwork Tue Apr 5 11:24:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maya Erez X-Patchwork-Id: 8749621 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 80A249F36E for ; Tue, 5 Apr 2016 11:24:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A318020396 for ; Tue, 5 Apr 2016 11:24:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A7CD920394 for ; Tue, 5 Apr 2016 11:24:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758074AbcDELYX (ORCPT ); Tue, 5 Apr 2016 07:24:23 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:27539 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757824AbcDELYV (ORCPT ); Tue, 5 Apr 2016 07:24:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1459855461; x=1491391461; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=5tpyYIsx+ZPNtCfWuLnwOjlzfGdc6yl+DoCkBIg8M7k=; b=g+UtWBqkRSq1XG1QUzt1Nvf7xjL5LvqQ7TGNtX4gFij7PCM0dJzjEP46 qHgyM2ZB3UuUq8ocyAGniBr9p/ae+DJCTrPA29gM0fR+/fWR/c8VuSAbw 4CDNp1x8cas8E8/shDw17ivHMNe5eK/UQndfCC70OBD/eSJYRJATy5i8h Y=; X-IronPort-AV: E=Sophos;i="5.24,443,1455004800"; d="scan'208";a="182633035" Received: from ironmsg02-r-new.qualcomm.com (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 05 Apr 2016 04:24:21 -0700 X-IronPort-AV: E=McAfee;i="5700,7163,8125"; a="703100878" Received: from lx-merez.mea.qualcomm.com ([10.18.177.171]) by ironmsg02-R.qualcomm.com with ESMTP; 05 Apr 2016 04:24:19 -0700 From: Maya Erez To: Kalle Valo Cc: Maya Erez , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com Subject: [PATCH 5/7] wil6210: unmask RX_HTRSH interrupt only when connected Date: Tue, 5 Apr 2016 14:24:05 +0300 Message-Id: <1459855447-17413-6-git-send-email-qca_merez@qca.qualcomm.com> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1459855447-17413-1-git-send-email-qca_merez@qca.qualcomm.com> References: <1459855447-17413-1-git-send-email-qca_merez@qca.qualcomm.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=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 RX_HTRSH interrupt sometimes triggered during device reset procedure. To prevent handling this interrupt when not required, unmask this interrupt only if we are connected and mask it when disconnected. Signed-off-by: Maya Erez --- drivers/net/wireless/ath/wil6210/interrupt.c | 6 +++++- drivers/net/wireless/ath/wil6210/main.c | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/wil6210/interrupt.c b/drivers/net/wireless/ath/wil6210/interrupt.c index 6897754..22592f3 100644 --- a/drivers/net/wireless/ath/wil6210/interrupt.c +++ b/drivers/net/wireless/ath/wil6210/interrupt.c @@ -38,6 +38,8 @@ #define WIL6210_IRQ_DISABLE (0xFFFFFFFFUL) #define WIL6210_IMC_RX (BIT_DMA_EP_RX_ICR_RX_DONE | \ BIT_DMA_EP_RX_ICR_RX_HTRSH) +#define WIL6210_IMC_RX_NO_RX_HTRSH (WIL6210_IMC_RX & \ + (~(BIT_DMA_EP_RX_ICR_RX_HTRSH))) #define WIL6210_IMC_TX (BIT_DMA_EP_TX_ICR_TX_DONE | \ BIT_DMA_EP_TX_ICR_TX_DONE_N(0)) #define WIL6210_IMC_MISC (ISR_MISC_FW_READY | \ @@ -109,8 +111,10 @@ void wil6210_unmask_irq_tx(struct wil6210_priv *wil) void wil6210_unmask_irq_rx(struct wil6210_priv *wil) { + bool unmask_rx_htrsh = test_bit(wil_status_fwconnected, wil->status); + wil_w(wil, RGF_DMA_EP_RX_ICR + offsetof(struct RGF_ICR, IMC), - WIL6210_IMC_RX); + unmask_rx_htrsh ? WIL6210_IMC_RX : WIL6210_IMC_RX_NO_RX_HTRSH); } static void wil6210_unmask_irq_misc(struct wil6210_priv *wil) diff --git a/drivers/net/wireless/ath/wil6210/main.c b/drivers/net/wireless/ath/wil6210/main.c index 8d4e884..261bdab 100644 --- a/drivers/net/wireless/ath/wil6210/main.c +++ b/drivers/net/wireless/ath/wil6210/main.c @@ -194,6 +194,18 @@ __acquires(&sta->tid_rx_lock) __releases(&sta->tid_rx_lock) memset(&sta->stats, 0, sizeof(sta->stats)); } +static bool wil_ap_is_connected(struct wil6210_priv *wil) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(wil->sta); i++) { + if (wil->sta[i].status == wil_sta_connected) + return true; + } + + return false; +} + static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, u16 reason_code, bool from_event) { @@ -247,6 +259,11 @@ static void _wil6210_disconnect(struct wil6210_priv *wil, const u8 *bssid, } clear_bit(wil_status_fwconnecting, wil->status); break; + case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_P2P_GO: + if (!wil_ap_is_connected(wil)) + clear_bit(wil_status_fwconnected, wil->status); + break; default: break; }