From patchwork Tue May 12 12:45:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6387631 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 8D065BEEE1 for ; Tue, 12 May 2015 12:46:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C0DC203F4 for ; Tue, 12 May 2015 12:46:16 +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 212F820414 for ; Tue, 12 May 2015 12:46:15 +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 1Ys9Zb-0005Tg-8D; Tue, 12 May 2015 12:46:11 +0000 Received: from mail-lb0-x236.google.com ([2a00:1450:4010:c04::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ys9ZX-0005Ic-Uw for ath10k@lists.infradead.org; Tue, 12 May 2015 12:46:08 +0000 Received: by lbbzk7 with SMTP id zk7so4868964lbb.0 for ; Tue, 12 May 2015 05:45:45 -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; bh=m4qbHZdcinYKcZRKQ8y7QsFfnxrgm+uROwHi/cUWylA=; b=pIw3Vy9O6c4OvWs42NKeQllLAYzwYvYqtU7CH0vswlJq0CTaXos1IBiNM+g5WxXDOm oP8pR8k3mXwTUX9zg+ziAn6U2t4ovvFT9tJbnNEq3ZIHkvBxqZXsZttzkNam0IllErjl 7eUpkZxQPykvO2xNXMUGmE9YreHDEY4XEEUUY= 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; bh=m4qbHZdcinYKcZRKQ8y7QsFfnxrgm+uROwHi/cUWylA=; b=EwSIdEokKT2kTXoc0zALHB0Iu+sojKCJzZ3qq3KRMrt94Lkq+zco+uSLQhPkCt9lUg 9dfvZShbDRp3tRGuqoCQ8svgzywWtZCtzFlhq7+O8j3KDUBPOhZcYnBvp093ahbJnB/E 0a/x2KyJwxHQYE+qsgq8dl6iORCU+drnUObuC8xfkVqaGGbFenpZBDSP4Up0hCpU8/3/ VtJPurh+UcVqEIYp4EOLQ3QtOieIa2u6bfIdS7LThubGv/ScUhJU0q1IQAVLog/CmsFj olpuyjPOwU/n9xVO1fSpZq7iXQH/2BBm1ZYq6Bz2wz6vETh7XROTRE1GNOvg5+gdeB0F Cr5Q== X-Gm-Message-State: ALoCoQmz5VSFQVN/iSGxH37S9XT+A3SNd5wpdvbEbhMbc35+j4UTq4ioWlzpHaj6IVy4b1va5hJPSsuc40YpwEqtUtgmXrk73rfvMlShWlcm6nbw5mOOIfyH3ceiSmX8ExZqPnvQxbwk7ArkIE8glUnhfBjQxp5lrDjFM2C+/qiYWjvxS6ofzv5DzE/iMFOqnRsiC0nfChwR X-Received: by 10.112.161.226 with SMTP id xv2mr12038924lbb.106.1431434745696; Tue, 12 May 2015 05:45:45 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id aj4sm3822143lbd.5.2015.05.12.05.45.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 12 May 2015 05:45:44 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH] amth10k: fix promisc handling Date: Tue, 12 May 2015 12:45:36 +0000 Message-Id: <1431434736-7077-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150512_054608_248484_A7E84157 X-CRM114-Status: GOOD ( 11.44 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior 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: , MIME-Version: 1.0 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 Patch df1404650ccb ("mac80211: remove support for IFF_PROMISC") removed promiscuous flag propagation to drivers. However the patch was designed against ath10k without 548462133d98 ("ath10k: fix interrupt storm"). After merge the code drifted into being no longer correct and due to monitor vdev being overzealously started caused IBSS to crash on 999.999.0.636 for QCA988X (this firmware revision is known to have issues with monitor vdev). This patch keeps expectations of commit 548462133d98 (i.e. reduce irq storm by not enabling monitor vdev for AP) and doesn't break existing (known) setups that imply promiscuous mode on network interfaces. Contrary to what it looks like 548462133d98 functionality is not reverted since the intention was a subset of what df1404650ccb did. Fixes: c17c997d5613 ("Merge git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next") Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 425dbe271495..594eb369ff7f 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1031,22 +1031,6 @@ 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->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 bool ath10k_mac_monitor_vdev_is_needed(struct ath10k *ar) { int num_ctx; @@ -1065,7 +1049,6 @@ static bool ath10k_mac_monitor_vdev_is_needed(struct ath10k *ar) return false; return ar->monitor || - !ath10k_mac_should_disable_promisc(ar) || test_bit(ATH10K_CAC_RUNNING, &ar->dev_flags); } @@ -1267,7 +1250,7 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, { struct ath10k *ar = arvif->ar; struct wmi_vdev_start_request_arg arg = {}; - int ret = 0, ret2; + int ret = 0; lockdep_assert_held(&ar->conf_mutex); @@ -1326,16 +1309,6 @@ static int ath10k_vdev_start_restart(struct ath10k_vif *arvif, 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; }