Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3509547pxf; Mon, 15 Mar 2021 11:07:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynWr532tazAm0kyi7Z/EwZ9ym4bN0jJEKowAKuAgc/5K9qHCFeouttSvHEPYExfguC1xN4 X-Received: by 2002:a17:906:eda3:: with SMTP id sa3mr25210249ejb.147.1615831631560; Mon, 15 Mar 2021 11:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831631; cv=none; d=google.com; s=arc-20160816; b=HDCBKC4Oq7DFZIJWfu1bmlvCurivmc4xtW8wkXJ58OANH0I0VI7o+hsjO9K0aUQOSQ uMSLxTBQ8cRn13XFuMFt4G+LPXb6NEAwVYyhS1E+dVLDS4kk95E7oASwivZTKmtg+5fB /yAjQD11Xxq14ay+DlcxnrbbSOAqLA4jBFIWW6gUuSUI81UYZr+KPhyK4Ky8VvSzXynu Snj0aoL98n1wz0Qv+A9saxhHmG4uLu3ii+0ppBlUXFIHu4iqdYVn+b/nsto3dBE+U+qs Kvd2MqTBYoqF+IA9dINLECBXrld3iy1BMK2oOkXRn0EaKL+KV2rgmBTYSQLXEbaVK/bq zOGg== 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=NyKhfz5y/xKemKTI23qczuf7BeYbfn/G0UIpFpa4xpw=; b=udlJqbZ5CDhbvufmH1A1V++zxHpupcASP585va/dm67F3sTrmCguApRbCuv9WmWaXy tINiTPTwrd6OH9Ndu5QdHqYyt8lWXGem9qf+6616mfgHH9HdvN4RdAVcPhXKpWOKAQkk vLaHZ+2teFNkIXbmTEMNQfxLFGzPRHaMfsOBDILEVAFwXHaHQocKulioDIDEp+eJl8Ll vHE7EzJiZX5sg91mKeSEkJCZvnEz76hkGStr2LZ9Sb5oTEuNAsgEfdEH86MlXo+zFe+c DXgS3wNLNw1WIe7/Rj2JBPvBp4dnbKryivMxAr2niM+CQehDky3hrzRe8yv3vePa9T5V U7Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z8vLS6SU; 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 y12si1753697eda.74.2021.03.15.11.06.45; Mon, 15 Mar 2021 11:07:11 -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=Z8vLS6SU; 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 S235453AbhCOOHj (ORCPT + 99 others); Mon, 15 Mar 2021 10:07:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229815AbhCON6B (ORCPT ); Mon, 15 Mar 2021 09:58:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C1DCC64F04; Mon, 15 Mar 2021 13:57:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816681; bh=nswGCUt+fiFwb6WHGUpuDzc9XaU0BOqhlvsOixL2YLA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z8vLS6SU4mP88kgFfmKPMFEkUwhmUOhGeiL4OVida2ZmSpM9y7Sch6xuz13SpKS8N ohBDfG5rznsWMoZB6hbS0MfgZKKNzXb1FSugUjbNPz781bFK3yz8FBBcmgcRiZgXQo mCa3o9r9CJXxIY3lz4L6zP8XFF5S2PN8MSDY5kVI= 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 4.19 003/120] ath9k: fix transmitting to stations in dynamic SMPS mode Date: Mon, 15 Mar 2021 14:55:54 +0100 Message-Id: <20210315135720.115158642@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -179,7 +179,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 @@ -1324,6 +1324,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); @@ -2206,6 +2211,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;