From patchwork Fri Feb 27 09:50:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 5899731 Return-Path: X-Original-To: patchwork-ath10k@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 5B4C6BF440 for ; Fri, 27 Feb 2015 09:55:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5545020211 for ; Fri, 27 Feb 2015 09:55:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 683432020F for ; Fri, 27 Feb 2015 09:55:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRHdU-0000IX-Rj; Fri, 27 Feb 2015 09:55:08 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YRHdO-0007y2-GL for ath10k@lists.infradead.org; Fri, 27 Feb 2015 09:55:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1425030903; x=1456566903; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ODyjU41697Ut9MxuHnHXgy2p9ZVDjHa+KPbxlTjIyZU=; b=WWz0sm/Bns7I0iq9soIbcQS3sc7qM30WUxjheLaqEIzILbNZTezjjoPW 542j9vjhco6TB6wFHn98JM39pYxIazgETCZ8sVxiRvGtvbiaw2Yi/Iu1Q 5VdEqd6qfgz9FM7i83iRv1VCbXqJeZ17yDn09FkGr4S+HT0ADDMnQpjwS U=; X-IronPort-AV: E=McAfee;i="5600,1067,7724"; a="105453016" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Feb 2015 01:54:41 -0800 X-IronPort-AV: E=Sophos;i="5.09,658,1418112000"; d="scan'208";a="859853195" Received: from nasanexm02c.na.qualcomm.com ([10.85.0.43]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 27 Feb 2015 01:54:41 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM02C.na.qualcomm.com (10.85.0.43) with Microsoft SMTP Server (TLS) id 15.0.995.29; Fri, 27 Feb 2015 01:54:39 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.995.29; Fri, 27 Feb 2015 01:54:31 -0800 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Fri, 27 Feb 2015 15:20:22 +0530 From: Vasanthakumar Thiagarajan To: Subject: [PATCH V3 2/2] ath10k: Fix interrupt storm Date: Fri, 27 Feb 2015 15:20:06 +0530 Message-ID: <1425030606-21933-2-git-send-email-vthiagar@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1425030606-21933-1-git-send-email-vthiagar@qti.qualcomm.com> References: <1425030606-21933-1-git-send-email-vthiagar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150227_015502_663805_52154770 X-CRM114-Status: GOOD ( 11.36 ) X-Spam-Score: -5.1 (-----) Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 Promiscuous mode is enabled when wlan interface is added to bridge. ath10k creates a monitor mode when promiscuous mode is enabled. When monitor vdev is runing along with other vdev(s) there is a huge number of interrupts generated especially in noisy condition. Fix this by not enabling promiscuous(monitor) mode when already a vdev is running. As disabling promiscuous mode may have issues with 4-address bridging in STA mode, the change is done specific to non-sta/ibss mode types. This does not change the support of virtual interface of type monitor along with other vdevs of any type. This could fix manangement frame drop in fw due to unavailable buffers because in monitor mode device receives everything seen on the air. In noisy condition, disabling monitor mode helps assoc go through without any issue. Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath10k/mac.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3b5aaa3..885e984 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -766,12 +766,36 @@ static int ath10k_monitor_stop(struct ath10k *ar) return 0; } +static bool ath10k_disable_promisc_mode(struct ath10k *ar) +{ + struct ath10k_vif *arvif; + + if (!ar->num_started_vdevs) + return false; + + list_for_each_entry(arvif, &ar->arvifs, list) { + /* Disabling promiscuous mode when STA/IBSS is running */ + if (arvif->vdev_type == WMI_VDEV_TYPE_STA || + arvif->vdev_type == WMI_VDEV_TYPE_IBSS) + return false; + } + + return true; +} + static int ath10k_monitor_recalc(struct ath10k *ar) { bool should_start; lockdep_assert_held(&ar->conf_mutex); + if ((ar->filter_flags & FIF_PROMISC_IN_BSS) && + ath10k_disable_promisc_mode(ar)) { + ar->filter_flags &= ~FIF_PROMISC_IN_BSS; + ath10k_dbg(ar, ATH10K_DBG_MAC, + "mac disabling promiscuous mode because vdev is started\n"); + } + should_start = ar->monitor || ar->filter_flags & FIF_PROMISC_IN_BSS || test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); @@ -969,6 +993,10 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart) ar->num_started_vdevs++; ath10k_recalc_radar_detection(ar); + ret = ath10k_monitor_recalc(ar); + if (ret) + ath10k_vdev_stop(arvif); + return ret; } @@ -3476,6 +3504,13 @@ static void ath10k_configure_filter(struct ieee80211_hw *hw, changed_flags &= SUPPORTED_FILTERS; *total_flags &= SUPPORTED_FILTERS; + if (*total_flags & FIF_PROMISC_IN_BSS) { + if (ar->num_started_vdevs) { + ath10k_dbg(ar, ATH10K_DBG_MAC, + "mac does not enable promiscuous mode when already a vdev is running\n"); + *total_flags &= ~FIF_PROMISC_IN_BSS; + } + } ar->filter_flags = *total_flags; ret = ath10k_monitor_recalc(ar);