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 29EA1189503; Tue, 30 Jul 2024 16:19:58 +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=1722356398; cv=none; b=fku4wLhvwGzVxAkYhKQItEYG4QA8UEekM2vOpCBnD4+5ihYYVhwuoWQiXOLeMGO+0jMdxffdYNhmnbcPE/dQIv1wB4pgRGJevacopEolmMU0sU5zxpCvz8D/cibSNT9372NZBm/Z2AfUD5/0ECZJO5ssNXyZbDcDw8zqKcY3jaQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722356398; c=relaxed/simple; bh=9bQIiTJTColinOsBOUqDTy88nBQutxRSJ6XEyouNB3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SgubvFMwGO01XEITbx+3InDoyPKxoAyqmFPINpaE8fJ/yhBLcpuBMTh32SdfeaWFKXrbkvQP6BLlA6/kpgVO2qsv/oz/6HmsL4Spiwp53NK5uoOMEUZEmO2I9uQGy5mo5EdCfpxrXQbvkx9DCZK7psX/a0RMqlScyMYR8KKbkfg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=D8c8QiJR; 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="D8c8QiJR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E83AC32782; Tue, 30 Jul 2024 16:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722356398; bh=9bQIiTJTColinOsBOUqDTy88nBQutxRSJ6XEyouNB3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D8c8QiJRmi/8fC5Hafuqyq4OtCppu7xXeE8XLE9OZKmSsiMVSxXRc8AD+Ci6ej3Zu sCF6aC2I+Mz9+bCVKC+j9nZFyRboxSK4QcfKPX1olqAXPl5HbXz+LA/DjM6D79YMrM yWL/U1hJzoBfff/TrK3xMU8b/Nozo8F7IGyE9mtI= 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 6.6 135/568] wifi: cfg80211: handle 2x996 RU allocation in cfg80211_calculate_bitrate_he() Date: Tue, 30 Jul 2024 17:44:02 +0200 Message-ID: <20240730151645.149303431@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240730151639.792277039@linuxfoundation.org> References: <20240730151639.792277039@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 6.6-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 187e29a30c2af..7acd8d0db61a7 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1480,7 +1480,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