Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2367518lqp; Sun, 24 Mar 2024 16:05:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQ/9y8b1nL/p6u7CDM3l+CrwESFYMKFOWMZfOs8cZbAvae38Fp1J0Sg6rEKNpnHAGhoflmmedqvCSEOk+QHOgZVCHbdTR1fAXY5CgaUA== X-Google-Smtp-Source: AGHT+IHbo77u4j3tbnzFMEEm0YGH0+pP3GHtFoVJcZTKZnMPlZjaMISWGnXCDn+mBxY3R4Ds5Nqi X-Received: by 2002:a05:6358:a082:b0:176:99f3:8d11 with SMTP id u2-20020a056358a08200b0017699f38d11mr2767254rwn.32.1711321548681; Sun, 24 Mar 2024 16:05:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711321548; cv=pass; d=google.com; s=arc-20160816; b=EwS68Lcv5aJYJzHWUrUwHVanb9s3DAh1qKR/Y5GsmBzvVKAPXY0ejF3NNKPVrxuggK FIbYP0NaSnCt+J7vFjKaNnlOjkZGyAXf/ITgLccFfZBXSjkK8KbxKvkJAXlz8CvxvfwV wddebPACWek1qDiZJP1QZsPGx5XFkodU8KbQsOh2fcAlbHnIcF6pWn95Om4obOCXZ/xN 0yz2vJxNZK88m4AvCJ8OwFZQ5uuEKaCXcZ1TJKTE6Vq69S0vUvFv4xOORvPMavfcWNGQ Ua4CYQJ/A0MpZU1qWoxg6ZZ+dOuDlz0V4zQDf+YY4luLph2uGk0LeZPGkVNoIwrD1ebu R9fw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=ztlzN20JrdvvEZCUQWtOZBvrqj7BjKCNUy89ClLqVTs=; fh=ppGCr8/IpmhC+yUpZmcDGlTBFJYuVX8De6EveHNs0ZQ=; b=B6uGEDgrzGwGORSo3CEm36t4HQstDiTaVz70XsB3hZ+7CyvPrNmxcVqD1+a4xlv8F3 uTjVDLwPyIewhSvtOi81VN+sGBvGVuLaWx6mIXCO3o7fPAoaCjDFEGHEaye17/ZlEwD4 7rcDNKsXiJH6NWzTNKVdZfWam5tZjs3ZJ/7mP7kvXxydF6GshjIj6Z/B7Lf1zAJJjgqJ a8pg9c3Clscw7z8mdnQ3xNZjY3bWJb6at/GWkvXPM+N1my51f39CFCfWHUFCcGkdASsb 5H9mcW3nZJnBrDs3bYlXr/S8/JN98d9xUi5FA6pVdnYhcixQ/ervv1zM3z8kJLs1hv/W 4u5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dEM73VGQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c74-20020a63354d000000b005f034b4f7e0si6282781pga.446.2024.03.24.16.05.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 16:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dEM73VGQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-112975-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112975-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 0FAC9B23B6C for ; Sun, 24 Mar 2024 22:56:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D805812B162; Sun, 24 Mar 2024 22:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="dEM73VGQ" 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 E6C0012B147; Sun, 24 Mar 2024 22:36:27 +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=1711319788; cv=none; b=rV24q7VHyKzTQ99FF1/H0KBoKsd+XcE/MzoHpZxcdmSDsMKbLYt9+ek0uS0PZUmbB78pAEWdpnVOlvSIXwjwauU4Df72kGKOpw/cxaeWzEn3mvpvn+86GwNbjHg5svd/XS2NhVeoIyjlvI7WcuZSAjdUnv1c292Lz0qS/+ILWAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711319788; c=relaxed/simple; bh=C3HRYMW5Znvaia7gAvlg0IcUGE4X37KAKyR3ou87898=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BAr/wcd+wc+StS7yqQQRaPv7mWBr1Denwe8TGLOLJtZo7yerjSvDYizd9mRY3hWbKnDA+4ZM0XHBNgyRudCaI85ktCdEWRWosmyMSGj5nTdsjD8AI17MFeQ3BpcHA2mNTUlevc9KUmNsAgQe8HOO2gbDQYBKMfpsI0K980TYgpE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=dEM73VGQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1D064C43390; Sun, 24 Mar 2024 22:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711319787; bh=C3HRYMW5Znvaia7gAvlg0IcUGE4X37KAKyR3ou87898=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEM73VGQrn7wCKWD2W+/Jk1+2DrH7id7CnHM4if9s+lCTlBmIuWDaGVJ0Ve0kbPCw zwordSVsFdN7NhlyGGOYGcXUiRMqzfTCHVUq7dMT7HfY1nkdICt1MG4/P344Jtu1jX ddhm5ZFllNg5du6b7FTZXg0tMGvSfoj0dp2VQQq9koU4P7O10BxVA8ZRoN4rR4j3U0 rtAwxhPaeiVpaKzsVf8iBs44b+7udn/AG2690PHEmw2eHGFabcZyZ3cOPdmpi6uA3M CygRQwZDtzjJ+z3V87tGRgNfqcPUHB+Jjyj7IotQLiYtcQvcKDotWqAY6UGQHVACW+ 18jVgbTkLYsmg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sriram R , Jeff Johnson , Kalle Valo , Sasha Levin Subject: [PATCH 6.8 088/715] wifi: ath12k: Fix issues in channel list update Date: Sun, 24 Mar 2024 18:24:27 -0400 Message-ID: <20240324223455.1342824-89-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Sriram R [ Upstream commit 67a48d937fac917947540c9f89630d472cd61fcb ] Currently, the logic used to select the 6 GHz band is incorrect, which may cause 6 GHz supported channels to not be updated properly. This is because the 6 GHz Max frequency supported by the driver is being compared to the Max frequency supported on the board. If in some cases, the 6 GHz Max frequency supported on the board is less than the defined 6 GHz Max frequency, all 6 GHz channels are disabled. To address this, compare the max frequency supported by the board to the defined 6 GHz Minimum frequency by the driver. Similarly, when a dual mac card supports both 6 GHz and 5 GHz radios, if the 5 GHz radio gets enumerated first before 6 GHz, the checks in ath12k_mac_setup_channels_rates() can cause the 5 GHz channels which were enabled earlier to get disabled when the 6 GHz channel list is updated. This is because the Min 6 GHz frequency defined in the driver is 5945 MHz, which should be 5925 MHz since channel 2 is not considered currently, but the firmware can pass 5925 MHz as the minimum. Hence, update the Min frequency supported by the driver to 5925 MHz. In addition, ensure that the channel list update to firmware updates only the channels that the current radio (ar) supports rather than considering the wiphy support. This would be required when multiple pdevs are supported in a wiphy and they support different ranges of frequencies or bands as in single wiphy support. Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.1.1-00188-QCAHKSWPL_SILICONZ-1 Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3 Signed-off-by: Sriram R Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://msgid.link/20240117062628.8260-1-quic_srirrama@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath12k/core.h | 2 +- drivers/net/wireless/ath/ath12k/mac.c | 2 +- drivers/net/wireless/ath/ath12k/reg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/core.h b/drivers/net/wireless/ath/ath12k/core.h index 8458dc292821a..01fb9b2ae4314 100644 --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h @@ -420,7 +420,7 @@ struct ath12k_sta { }; #define ATH12K_MIN_5G_FREQ 4150 -#define ATH12K_MIN_6G_FREQ 5945 +#define ATH12K_MIN_6G_FREQ 5925 #define ATH12K_MAX_6G_FREQ 7115 #define ATH12K_NUM_CHANS 100 #define ATH12K_MAX_5G_CHAN 173 diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c index 88cec54c6c2e6..f4e5dc363472b 100644 --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c @@ -7198,7 +7198,7 @@ static int ath12k_mac_setup_channels_rates(struct ath12k *ar, } if (supported_bands & WMI_HOST_WLAN_5G_CAP) { - if (reg_cap->high_5ghz_chan >= ATH12K_MAX_6G_FREQ) { + if (reg_cap->high_5ghz_chan >= ATH12K_MIN_6G_FREQ) { channels = kmemdup(ath12k_6ghz_channels, sizeof(ath12k_6ghz_channels), GFP_KERNEL); if (!channels) { diff --git a/drivers/net/wireless/ath/ath12k/reg.c b/drivers/net/wireless/ath/ath12k/reg.c index f924bc13ccff5..29542c46b0941 100644 --- a/drivers/net/wireless/ath/ath12k/reg.c +++ b/drivers/net/wireless/ath/ath12k/reg.c @@ -103,7 +103,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) bands = hw->wiphy->bands; for (band = 0; band < NUM_NL80211_BANDS; band++) { - if (!bands[band]) + if (!(ar->mac.sbands[band].channels && bands[band])) continue; for (i = 0; i < bands[band]->n_channels; i++) { @@ -129,7 +129,7 @@ int ath12k_reg_update_chan_list(struct ath12k *ar) ch = arg->channel; for (band = 0; band < NUM_NL80211_BANDS; band++) { - if (!bands[band]) + if (!(ar->mac.sbands[band].channels && bands[band])) continue; for (i = 0; i < bands[band]->n_channels; i++) { -- 2.43.0