Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3319650pxf; Mon, 15 Mar 2021 07:04:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/VWL9q4r0ZNxaDWiJlmPUf+cVGEii8iSvSQ74rdb6YdqRZeiG4Bro28CjpRmUAQu1xyyf X-Received: by 2002:aa7:d5c9:: with SMTP id d9mr31191705eds.102.1615817081550; Mon, 15 Mar 2021 07:04:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817081; cv=none; d=google.com; s=arc-20160816; b=ZDhAAMO1CcH/rBqbCIfu4PEB5naLRvQn8vSQ6DumjhjmDzFjUeL6GWl9CJ57bwiefl x0ZulhIw0G/zbHnJ+b8gVxPmDAAK5nk3YVXfCHUWdPpwk06guUyyNIJ5HPVY8EjAmsNg HV6dkZYoJbdpRQ/HMQdT/VWO8WamrAn1ALIxisaKxi0/kmUJLjvmeT/QYSBg3FNjA22B tZ0f2YC747eDlbuYc3NUGsilEyavFaUF9+bmn1PvFBqrqxzuvtkJx2bBVlKyyit31LZb U+WJpKamx4vMoHOtYAEinykkkCEsfbAl9n5hrtzwHRQS8nkfS4igbepPPdhua/0eWRxz byzA== 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=Mu80z/gQfNreCQzErlDBGjtnp7+UW8gvnrLKMz4wP08=; b=YxTqS11zF8DOpaSlK6nad9Yc9BCnIBOIf5rqilST+VYFgb35PcEbEgQw8EDvT1RlYL YypKgO7NyzE5K2inWsQhaDXthQUbk1cSz4O6xOfkBxATROnw+av3Ir/mc4ZvIeOVUGI9 XxNNumCOv6dQPMRpSRx/GH5XTjouroP0gx2IFzS2bhSZQUV2pbK8dY2Sb6BG/doui4Rf rS0YAFuajTw6ls/1kqs5rI70CunfIC8mykBvwbwT9KXkk3EXUPY2iagjq+y5Xhqm/ZuB 10yN8rUSSGWendeDHFjv0bIAUDRSdGxrxGHRayN0IBsKyVT50MV68kcwHfU2AWCmCxT9 hw/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0UIJYLBD; 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 f25si11498790edr.248.2021.03.15.07.04.18; Mon, 15 Mar 2021 07:04:41 -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=0UIJYLBD; 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 S233828AbhCOOCa (ORCPT + 99 others); Mon, 15 Mar 2021 10:02:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:33462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231774AbhCON4w (ORCPT ); Mon, 15 Mar 2021 09:56:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0F4E564EFE; Mon, 15 Mar 2021 13:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816612; bh=m8qvx503ZzbjdaPq3SjYeJMXUDyqCD3rTs07Q2himbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0UIJYLBDFa4zwnCp628FdsGB4muXC1d2AXipCMncayHd9VOY6C9sZp+Q61C5vnIHN GUnotOdTM7gS3RpSY3Cz6uclCDIE30eTfZ5TzyiyB3VDGd0x8xSzdMmMtMT+zyAj6M 6MOJIDUnhc5OFVTXAV0SihTf6REjeRsQM7LKZu1c= 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.4 004/168] ath9k: fix transmitting to stations in dynamic SMPS mode Date: Mon, 15 Mar 2021 14:53:56 +0100 Message-Id: <20210315135550.486160107@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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); @@ -2111,6 +2116,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;