From patchwork Mon Mar 2 12:15:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 5911951 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 86E909F373 for ; Mon, 2 Mar 2015 12:20:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A037E2015E for ; Mon, 2 Mar 2015 12:20:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A55FC20166 for ; Mon, 2 Mar 2015 12:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753545AbbCBMUX (ORCPT ); Mon, 2 Mar 2015 07:20:23 -0500 Received: from sabertooth02.qualcomm.com ([65.197.215.38]:8461 "EHLO sabertooth02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537AbbCBMUV (ORCPT ); Mon, 2 Mar 2015 07:20:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1425298822; x=1456834822; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=1nrxflF44sF7szrj9PveGFdug11uNcOXdk02M6W/bdc=; b=lFOJ9uciAbv9NlmAN6jywcmCmemFxJ30L3IklsMkGABTVaCjReBYyAIN Jhi4HGkWksrbVlwFtGM8XHJXZ1Q5Q6KW8wzYqOKrWVBUT+52BC0VJgeQk kZfEPlrJYvWnOxW4F9ZvV9m3rqMHJumVvGT/1LvR7qlKzDQV6J/WHY5p8 Y=; X-IronPort-AV: E=McAfee;i="5600,1067,7727"; a="84915589" Received: from ironmsg01-lv.qualcomm.com ([10.47.202.180]) by sabertooth02.qualcomm.com with ESMTP; 02 Mar 2015 04:20:22 -0800 X-IronPort-AV: E=Sophos;i="5.09,675,1418112000"; d="scan'208";a="32500328" Received: from nasanexm01d.na.qualcomm.com ([10.85.0.84]) by ironmsg01-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 02 Mar 2015 04:20:21 -0800 Received: from aphydexm01a.ap.qualcomm.com (10.252.127.10) by NASANEXM01D.na.qualcomm.com (10.85.0.84) with Microsoft SMTP Server (TLS) id 15.0.995.29; Mon, 2 Mar 2015 04:20:19 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01a.ap.qualcomm.com (10.252.127.10) with Microsoft SMTP Server (TLS) id 15.0.995.29; Mon, 2 Mar 2015 17:50:10 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Mon, 02 Mar 2015 17:45:53 +0530 From: Vasanthakumar Thiagarajan To: CC: , Vasanthakumar Thiagarajan Subject: [PATCH V5 2/2] ath10k: Fix interrupt storm Date: Mon, 2 Mar 2015 17:45:28 +0530 Message-ID: <1425298528-3067-2-git-send-email-vthiagar@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1425298528-3067-1-git-send-email-vthiagar@qti.qualcomm.com> References: <1425298528-3067-1-git-send-email-vthiagar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To aphydexm01a.ap.qualcomm.com (10.252.127.10) 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=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 running 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 management 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 | 34 +++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 3b5aaa3..c220c51 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -766,6 +766,25 @@ static int ath10k_monitor_stop(struct ath10k *ar) return 0; } +static bool ath10k_mac_should_disable_promisc(struct ath10k *ar) +{ + struct ath10k_vif *arvif; + + if (!(ar->filter_flags & FIF_PROMISC_IN_BSS)) + return true; + + if (!ar->num_started_vdevs) + return false; + + list_for_each_entry(arvif, &ar->arvifs, list) + if (arvif->vdev_type != WMI_VDEV_TYPE_AP) + return false; + + ath10k_dbg(ar, ATH10K_DBG_MAC, + "mac disabling promiscuous mode because vdev is started\n"); + return true; +} + static int ath10k_monitor_recalc(struct ath10k *ar) { bool should_start; @@ -773,7 +793,7 @@ static int ath10k_monitor_recalc(struct ath10k *ar) lockdep_assert_held(&ar->conf_mutex); should_start = ar->monitor || - ar->filter_flags & FIF_PROMISC_IN_BSS || + !ath10k_mac_should_disable_promisc(ar); test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); ath10k_dbg(ar, ATH10K_DBG_MAC, @@ -910,7 +930,7 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, bool restart) struct ath10k *ar = arvif->ar; struct cfg80211_chan_def *chandef = &ar->chandef; struct wmi_vdev_start_request_arg arg = {}; - int ret = 0; + int ret = 0, ret2; lockdep_assert_held(&ar->conf_mutex); @@ -969,6 +989,16 @@ 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_warn(ar, "mac failed to recalc monitor for vdev %i restart %d: %d\n", + arg.vdev_id, restart, ret); + ret2 = ath10k_vdev_stop(arvif); + if (ret2) + ath10k_warn(ar, "mac failed to stop vdev %i restart %d: %d\n", + arg.vdev_id, restart, ret2); + } + return ret; }