Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3319208pxf; Mon, 15 Mar 2021 07:04:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGJadWuG5RAstLCZN8CX/rDPKABc1fKAexJih36BBWn8BGPmJashhK7+qXfb7XRy3qlWAp X-Received: by 2002:a17:907:20c7:: with SMTP id qq7mr23080683ejb.528.1615817056519; Mon, 15 Mar 2021 07:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817056; cv=none; d=google.com; s=arc-20160816; b=TXPqwV0wJNYepU7noOIlx6mz88sSM0VNFAKMsh36clpcqqcHebEt5+//ExMMwx+wCo BVQslnYPCR9bMe7OHUfmsKrRseutQCM25IqCnZ+4mFxybmcYbJuOmwKHoyz9I3yjLvR8 PupjkyHiuEqyOpgAODJamP8svFa9LNlojNWlg/S+82DcQt9AGsJiavY6z44tLR1AcZkY mxPPm4wz5/9y61y0fNfOWSCgmfSti9sU2L/RVXxqR2n68QApdnK+qLkihzHzqslBGI1b J6Zb84h7he7JrA4U3sthUbVauLGA3FB1tr3hryghVMyVryrkWFuzwTangHyXSzfPP4Ql 5vvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pfvyIV1Mat3zJiWEHEkxK24aY+v5nMFCgOum+HtuM8U=; b=0Ei3o9HDPF+ePLU7HuUemDf1Ff9KouZCNfoGffg1WNOsSNtTrMs4MeD22jL5O+WEWk MJ0pcn5O+BtxnRlAczUpQ5vG6ZYzfSTfEQVqzdOR3fg8LYho0rKEpwhB8e9ZLCW0eP9p 6bVCuKWo8tfvuiwDe4VibN/oJkpNRZF9UaKt4pWURgPy32Gx0EQ980nUhsi9xGv1Db89 VqGmn/Sh6oHehGNokaZH42EkqTntNA/VhaCNYf1FWerIoC0cSGo8jtQ4Rq4+Wsb8DMiM wI10DjMGup2GHXtRJZ4GCqVMfmQABIbFRKUX9NnQbmzkuxZCNczjyEzhaGFZPz7oVdiX jpOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wNOUiRgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g19si11042970ejf.52.2021.03.15.07.03.52; Mon, 15 Mar 2021 07:04:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wNOUiRgU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233331AbhCOOB3 (ORCPT + 99 others); Mon, 15 Mar 2021 10:01:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:33286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231130AbhCON4m (ORCPT ); Mon, 15 Mar 2021 09:56:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 65F0864EF8; Mon, 15 Mar 2021 13:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816600; bh=YgK7z5OuoTYfHFxczuQxZsrqwMpzCQi6HapODk0JIQk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wNOUiRgU7KyzGBS3TtWwV9VeHenGLyD5E6LruP8/4GygUzOSSUV20I57u+VIEc3Vn g7O/ZquAV6bXgQqA48htqhxikF5Lq2vErF+RGANgv5NOWVA87cYF0e8UeuwwakxW+E S/Lzpi1z68v8NxuDk/aYvy1LTAEQjDYqoUXOriiw= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Martin Kennedy , Felix Fietkau , Kalle Valo Subject: [PATCH 5.10 006/290] ath9k: fix transmitting to stations in dynamic SMPS mode Date: Mon, 15 Mar 2021 14:51:39 +0100 Message-Id: <20210315135542.156631808@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Felix Fietkau commit 3b9ea7206d7e1fdd7419cbd10badd3b2c80d04b4 upstream. When transmitting to a receiver in dynamic SMPS mode, all transmissions that use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to give the receiver's extra chains some time to wake up. This fixes the tx rate getting stuck at <= MCS7 for some clients, especially Intel ones, which make aggressive use of SMPS. Cc: stable@vger.kernel.org Reported-by: Martin Kennedy Signed-off-by: Felix Fietkau Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20210214184911.96702-1-nbd@nbd.name Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath9k/ath9k.h | 3 ++- drivers/net/wireless/ath/ath9k/xmit.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -177,7 +177,8 @@ struct ath_frame_info { s8 txq; u8 keyix; u8 rtscts_rate; - u8 retries : 7; + u8 retries : 6; + u8 dyn_smps : 1; u8 baw_tracked : 1; u8 tx_power; enum ath9k_key_type keytype:2; --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -1271,6 +1271,11 @@ static void ath_buf_set_rate(struct ath_ is_40, is_sgi, is_sp); if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC; + if (rix >= 8 && fi->dyn_smps) { + info->rates[i].RateFlags |= + ATH9K_RATESERIES_RTS_CTS; + info->flags |= ATH9K_TXDESC_CTSENA; + } info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, is_40, false); @@ -2114,6 +2119,7 @@ static void setup_frame_info(struct ieee fi->keyix = an->ps_key; else fi->keyix = ATH9K_TXKEYIX_INVALID; + fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC; fi->keytype = keytype; fi->framelen = framelen; fi->tx_power = txpower;