From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B93BC18CBE1; Thu, 15 Aug 2024 14:28:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723732103; cv=none; b=JcdQ4C3a9DemLTeJ3y8/5SW5Gs3eSFjebBBFIojNvK7SNfyWAKKArN+qnktprZ2GabwYh+eWYyVxyS/G174G6phfNXJz2cLYw+iXwWS4IS+2cnyZIMDA5UeF4YW0sehNivzNwURNu+fmDQLRn9Wo2in3IIKX6KkpAWht3hRHpCk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723732103; c=relaxed/simple; bh=weel5j/r9PwRo+CJKHYGfx8O8jZfExWh2xRMaCm/7o0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wv+pa0Fy4MSMGFIb9InizhnDsfnsMRJNrPE76PhuXWlZQDv8475qCL5y4uh8KfOAAizU2dtwSSKDqflshg09fygCPjjgVUTibSBYDjJQdrBo4tbytRu3XbyCHRgMOTYrXSE/1NJXj1vRVN8VMosD3yX4C9q/gSSQHUzIbdgaHBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rKFFyHQa; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="rKFFyHQa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 299BAC32786; Thu, 15 Aug 2024 14:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1723732103; bh=weel5j/r9PwRo+CJKHYGfx8O8jZfExWh2xRMaCm/7o0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rKFFyHQahzwSbwyh4Zqp+bBMw5fClLvuQ6arSXOkNFicFg1VV0Na3OV+f2wFjHTBs UNkupnXo4UnsckQ/h2SfBGtKUlxz+yK1SbErGcC8p8XAc9JB4BftpFGxJf2kevCwV8 xdoRfX5C4cLteCQI9iStfZk4BY6KuqaUOQnh47e0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Baochen Qiang , Johannes Berg , Sasha Levin Subject: [PATCH 5.10 048/352] wifi: cfg80211: handle 2x996 RU allocation in cfg80211_calculate_bitrate_he() Date: Thu, 15 Aug 2024 15:21:54 +0200 Message-ID: <20240815131921.096685594@linuxfoundation.org> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240815131919.196120297@linuxfoundation.org> References: <20240815131919.196120297@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Baochen Qiang [ Upstream commit bcbd771cd5d68c0c52567556097d75f9fc4e7cd6 ] Currently NL80211_RATE_INFO_HE_RU_ALLOC_2x996 is not handled in cfg80211_calculate_bitrate_he(), leading to below warning: kernel: invalid HE MCS: bw:6, ru:6 kernel: WARNING: CPU: 0 PID: 2312 at net/wireless/util.c:1501 cfg80211_calculate_bitrate_he+0x22b/0x270 [cfg80211] Fix it by handling 2x996 RU allocation in the same way as 160 MHz bandwidth. Fixes: c4cbaf7973a7 ("cfg80211: Add support for HE") Signed-off-by: Baochen Qiang Link: https://msgid.link/20240606020653.33205-3-quic_bqiang@quicinc.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/util.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 0d5b1c18d62f2..37719fc39f64d 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1354,7 +1354,9 @@ static u32 cfg80211_calculate_bitrate_he(struct rate_info *rate) if (WARN_ON_ONCE(rate->nss < 1 || rate->nss > 8)) return 0; - if (rate->bw == RATE_INFO_BW_160) + if (rate->bw == RATE_INFO_BW_160 || + (rate->bw == RATE_INFO_BW_HE_RU && + rate->he_ru_alloc == NL80211_RATE_INFO_HE_RU_ALLOC_2x996)) result = rates_160M[rate->he_gi]; else if (rate->bw == RATE_INFO_BW_80 || (rate->bw == RATE_INFO_BW_HE_RU && -- 2.43.0