324e59
From patchwork Wed Jul  3 08:10:49 2019
324e59
Content-Type: text/plain; charset="utf-8"
324e59
MIME-Version: 1.0
324e59
Content-Transfer-Encoding: 7bit
324e59
X-Patchwork-Submitter: Luca Coelho <luca@coelho.fi>
324e59
X-Patchwork-Id: 11029027
324e59
X-Patchwork-Delegate: kvalo@adurom.com
324e59
Return-Path: <linux-wireless-owner@kernel.org>
324e59
Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org
324e59
 [172.30.200.125])
324e59
	by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4F061398
324e59
	for <patchwork-linux-wireless@patchwork.kernel.org>;
324e59
 Wed,  3 Jul 2019 08:11:03 +0000 (UTC)
324e59
Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1])
324e59
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93D7228807
324e59
	for <patchwork-linux-wireless@patchwork.kernel.org>;
324e59
 Wed,  3 Jul 2019 08:11:03 +0000 (UTC)
324e59
Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486)
324e59
	id 82C5C28786; Wed,  3 Jul 2019 08:11:03 +0000 (UTC)
324e59
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
324e59
	pdx-wl-mail.web.codeaurora.org
324e59
X-Spam-Level: 
324e59
X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI,
324e59
	RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1
324e59
Received: from vger.kernel.org (vger.kernel.org [209.132.180.67])
324e59
	by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A56D28786
324e59
	for <patchwork-linux-wireless@patchwork.kernel.org>;
324e59
 Wed,  3 Jul 2019 08:11:03 +0000 (UTC)
324e59
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
324e59
        id S1727179AbfGCILC (ORCPT
324e59
        <rfc822;patchwork-linux-wireless@patchwork.kernel.org>);
324e59
        Wed, 3 Jul 2019 04:11:02 -0400
324e59
Received: from paleale.coelho.fi ([176.9.41.70]:54844 "EHLO
324e59
        farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org
324e59
        with ESMTP id S1727052AbfGCILC (ORCPT
324e59
        <rfc822;linux-wireless@vger.kernel.org>);
324e59
        Wed, 3 Jul 2019 04:11:02 -0400
324e59
Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193]
324e59
 helo=redipa.ger.corp.intel.com)
324e59
        by farmhouse.coelho.fi with esmtpsa
324e59
 (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
324e59
        (Exim 4.92)
324e59
        (envelope-from <luca@coelho.fi>)
324e59
        id 1hiaLv-0004w3-Ei; Wed, 03 Jul 2019 11:10:55 +0300
324e59
From: Luca Coelho <luca@coelho.fi>
324e59
To: davem@davemloft.net
324e59
Cc: kvalo@codeaurora.org, linux-wireless@vger.kernel.org,
324e59
        emmanuel.grumbach@intel.com, johannes.hirte@datenkhaos.de,
324e59
        steven@uplinklabs.net, Johannes Berg <johannes.berg@intel.com>,
324e59
        Luca Coelho <luciano.coelho@intel.com>
324e59
Subject: [PATCH for v5.2] iwlwifi: mvm: disable TX-AMSDU on older NICs
324e59
Date: Wed,  3 Jul 2019 11:10:49 +0300
324e59
Message-Id: <20190703081049.28831-1-luca@coelho.fi>
324e59
X-Mailer: git-send-email 2.20.1
324e59
MIME-Version: 1.0
324e59
Sender: linux-wireless-owner@vger.kernel.org
324e59
Precedence: bulk
324e59
List-ID: <linux-wireless.vger.kernel.org>
324e59
X-Mailing-List: linux-wireless@vger.kernel.org
324e59
X-Virus-Scanned: ClamAV using ClamSMTP
324e59
Jeremy Cline 9a5cab
From: Johannes Berg <johannes.berg@intel.com>
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
On older NICs, we occasionally see issues with A-MSDU support,
Jeremy Cline 9a5cab
where the commands in the FIFO get confused and then we see an
Jeremy Cline 9a5cab
assert EDC because the next command in the FIFO isn't TX.
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
We've tried to isolate this issue and understand where it comes
Jeremy Cline 9a5cab
from, but haven't found any errors in building the A-MSDU in
Jeremy Cline 9a5cab
software.
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
At least for now, disable A-MSDU support on older hardware so
Jeremy Cline 9a5cab
that users can use it again without fearing the assert.
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
This fixes https://bugzilla.kernel.org/show_bug.cgi?id=203315.
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Jeremy Cline 9a5cab
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Jeremy Cline 9a5cab
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Jeremy Cline 9a5cab
---
Jeremy Cline 9a5cab
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 14 +++++++++++++-
Jeremy Cline 9a5cab
 1 file changed, 13 insertions(+), 1 deletion(-)
Jeremy Cline 9a5cab
Jeremy Cline 9a5cab
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
324e59
index fdbabca0280e..3a076e5e319f 100644
Jeremy Cline 9a5cab
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
Jeremy Cline 9a5cab
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
324e59
@@ -468,7 +468,19 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
Jeremy Cline 9a5cab
 	ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW);
Jeremy Cline 9a5cab
 	ieee80211_hw_set(hw, BUFF_MMPDU_TXQ);
Jeremy Cline 9a5cab
 	ieee80211_hw_set(hw, STA_MMPDU_TXQ);
Jeremy Cline 9a5cab
-	ieee80211_hw_set(hw, TX_AMSDU);
Jeremy Cline 9a5cab
+	/*
Jeremy Cline 9a5cab
+	 * On older devices, enabling TX A-MSDU occasionally leads to
Jeremy Cline 9a5cab
+	 * something getting messed up, the command read from the FIFO
Jeremy Cline 9a5cab
+	 * gets out of sync and isn't a TX command, so that we have an
Jeremy Cline 9a5cab
+	 * assert EDC.
Jeremy Cline 9a5cab
+	 *
Jeremy Cline 9a5cab
+	 * It's not clear where the bug is, but since we didn't used to
Jeremy Cline 9a5cab
+	 * support A-MSDU until moving the mac80211 iTXQs, just leave it
Jeremy Cline 9a5cab
+	 * for older devices. We also don't see this issue on any newer
Jeremy Cline 9a5cab
+	 * devices.
Jeremy Cline 9a5cab
+	 */
Jeremy Cline 9a5cab
+	if (mvm->cfg->device_family >= IWL_DEVICE_FAMILY_9000)
Jeremy Cline 9a5cab
+		ieee80211_hw_set(hw, TX_AMSDU);
Jeremy Cline 9a5cab
 	ieee80211_hw_set(hw, TX_FRAG_LIST);
Jeremy Cline 9a5cab
 
Jeremy Cline 9a5cab
 	if (iwl_mvm_has_tlc_offload(mvm)) {