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 8CACD299931; Sat, 14 Feb 2026 21:26:03 +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=1771104363; cv=none; b=n4zc48U4V5vANxLxM8fmBlcM8WyDV8eCTRLdbq0XYLFwpBfgIgmUy9l7rg0v/2QLl09P/c18XhkroFRUd4+yySIsMJC/jzkmA2bA3nFNfX5wMKe6oGoa5OVwvWNiLTmCGx9/q0/zJgMh15W5HFiyYvo5wO5iMjwkzbGnXFNecAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771104363; c=relaxed/simple; bh=jdjBYuLyWUoR/3Tzz15H/qXhA4J4QfVQrEs28NTG/MM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W0DSs+XpNawy7n8JfoJZBtkkQJyBZ+UinfdOn/WW51xwm6blA/sK286ozRzen27Fpk4Rs/zUHOAnstmpIQnSsRrXI1E3GivB1Kxmka133qgou+STvz/71wY/ZkCr0crDT/eGkLmWyViI9zfCizfT7bpXHgKi50ZBaATGFbUY9AQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eQdqq8sq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="eQdqq8sq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AB70C16AAE; Sat, 14 Feb 2026 21:26:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771104363; bh=jdjBYuLyWUoR/3Tzz15H/qXhA4J4QfVQrEs28NTG/MM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eQdqq8sqmSqE3bxOp4wV5RrdXMMe+CuNFMmroEj6z5lRekIAn0dybIHlpWJDln8R3 Zw96eIy8VEtYTMaEUvPuQwMtKRoVTVJ68vtVvN65ztV1aDNDIAV52/pmuBZ+KkdZog MTktta6Sq3Wau7dQYQDUd3mQdYmjwb9Kx+ZekHXV0zVNRVtxzpXv/uGSJ5KAmOJtKB NU8vf18qYGBZIrle/8J3UkZlTIDW0hdW0W2jxNLl2vPbGACU3AtlDuoFMYfpARgVDB uhB2kROHLfs44NYwXZuzhYvtuy3Z3AYTM8G9qinMXHqjN2M5rk8UYE0OqH9IKmbYAG nuVSYD4lIrV4A== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Baochen Qiang , Vasanthakumar Thiagarajan , Jeff Johnson , Sasha Levin , jjohnson@kernel.org, linux-wireless@vger.kernel.org, ath12k@lists.infradead.org Subject: [PATCH AUTOSEL 6.19-6.18] wifi: ath12k: fix mac phy capability parsing Date: Sat, 14 Feb 2026 16:23:07 -0500 Message-ID: <20260214212452.782265-42-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260214212452.782265-1-sashal@kernel.org> References: <20260214212452.782265-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.19 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Baochen Qiang [ Upstream commit b5151c9b6e3a347416a4b4b55fc00195526d8771 ] Currently ath12k_pull_mac_phy_cap_svc_ready_ext() assumes only one band supported in each phy, hence it skips 5 GHz band if 2 GHz band support is detected. This does not work for device which gets only one phy but has both bands supported, such as QCC2072. Change to check each band individually to fix this issue. Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3 Signed-off-by: Baochen Qiang Reviewed-by: Vasanthakumar Thiagarajan Link: https://patch.msgid.link/20260112-ath12k-support-qcc2072-v2-6-fc8ce1e43969@oss.qualcomm.com Signed-off-by: Jeff Johnson Signed-off-by: Sasha Levin --- LLM Generated explanations, may be completely bogus: ### Dependency Concerns The investigation reveals an important dependency issue: - The constants were **renamed** from `WMI_HOST_WLAN_2G_CAP`/`WMI_HOST_WLAN_5G_CAP` to `WMI_HOST_WLAN_2GHZ_CAP`/`WMI_HOST_WLAN_5GHZ_CAP` in March 2025 (commit `6a88093f79ea0`). If backporting to a stable tree that predates this rename, the constant names would need adjustment. - The `nss_ratio` fields were added in June 2025 - older stable trees may not have these. - The ath12k driver itself was introduced in November 2022, so stable trees from 6.1.y onward should have the driver. The core logic change (if/else if → independent if checks) is self- contained and the fix concept applies regardless of these naming differences, though minor backport adjustments to constant names may be needed for older stable trees. ### Risk vs. Benefit - **Benefit:** Fixes a real functional bug where dual-band single-PHY WiFi devices (like QCC2072) cannot use 5 GHz band at all. This is a significant hardware functionality issue. - **Risk:** Very low. The logic change is straightforward and doesn't affect single-band devices. The only behavioral change for dual-band devices is that both bands are now properly initialized instead of only one. ### Conclusion This is a clear bug fix in a wireless driver that prevents hardware from working correctly. The fix is: - Small and contained (single function, single file) - Obviously correct (the if/else if logic was clearly wrong for dual- band PHYs) - Tested and reviewed - Low risk of regression - Fixes a real user-visible issue (5 GHz band not working) The only minor concern is that backporting may require adjusting constant names for older stable trees, but this is a trivial mechanical adjustment. **YES** drivers/net/wireless/ath/ath12k/wmi.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/wmi.c b/drivers/net/wireless/ath/ath12k/wmi.c index 12f4d378f50d4..1613492b38350 100644 --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c @@ -496,6 +496,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, struct ath12k_band_cap *cap_band; struct ath12k_pdev_cap *pdev_cap = &pdev->cap; struct ath12k_fw_pdev *fw_pdev; + u32 supported_bands; u32 phy_map; u32 hw_idx, phy_idx = 0; int i; @@ -519,14 +520,19 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, return -EINVAL; mac_caps = wmi_mac_phy_caps + phy_idx; + supported_bands = le32_to_cpu(mac_caps->supported_bands); + + if (!(supported_bands & WMI_HOST_WLAN_2GHZ_CAP) && + !(supported_bands & WMI_HOST_WLAN_5GHZ_CAP)) + return -EINVAL; pdev->pdev_id = ath12k_wmi_mac_phy_get_pdev_id(mac_caps); pdev->hw_link_id = ath12k_wmi_mac_phy_get_hw_link_id(mac_caps); - pdev_cap->supported_bands |= le32_to_cpu(mac_caps->supported_bands); + pdev_cap->supported_bands |= supported_bands; pdev_cap->ampdu_density = le32_to_cpu(mac_caps->ampdu_density); fw_pdev = &ab->fw_pdev[ab->fw_pdev_count]; - fw_pdev->supported_bands = le32_to_cpu(mac_caps->supported_bands); + fw_pdev->supported_bands = supported_bands; fw_pdev->pdev_id = ath12k_wmi_mac_phy_get_pdev_id(mac_caps); fw_pdev->phy_id = le32_to_cpu(mac_caps->phy_id); ab->fw_pdev_count++; @@ -535,10 +541,12 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, * band to band for a single radio, need to see how this should be * handled. */ - if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2GHZ_CAP) { + if (supported_bands & WMI_HOST_WLAN_2GHZ_CAP) { pdev_cap->tx_chain_mask = le32_to_cpu(mac_caps->tx_chain_mask_2g); pdev_cap->rx_chain_mask = le32_to_cpu(mac_caps->rx_chain_mask_2g); - } else if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5GHZ_CAP) { + } + + if (supported_bands & WMI_HOST_WLAN_5GHZ_CAP) { pdev_cap->vht_cap = le32_to_cpu(mac_caps->vht_cap_info_5g); pdev_cap->vht_mcs = le32_to_cpu(mac_caps->vht_supp_mcs_5g); pdev_cap->he_mcs = le32_to_cpu(mac_caps->he_supp_mcs_5g); @@ -548,8 +556,6 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, WMI_NSS_RATIO_EN_DIS_GET(mac_caps->nss_ratio); pdev_cap->nss_ratio_info = WMI_NSS_RATIO_INFO_GET(mac_caps->nss_ratio); - } else { - return -EINVAL; } /* tx/rx chainmask reported from fw depends on the actual hw chains used, @@ -565,7 +571,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, pdev_cap->rx_chain_mask_shift = find_first_bit((unsigned long *)&pdev_cap->rx_chain_mask, 32); - if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_2GHZ_CAP) { + if (supported_bands & WMI_HOST_WLAN_2GHZ_CAP) { cap_band = &pdev_cap->band[NL80211_BAND_2GHZ]; cap_band->phy_id = le32_to_cpu(mac_caps->phy_id); cap_band->max_bw_supported = le32_to_cpu(mac_caps->max_bw_supported_2g); @@ -585,7 +591,7 @@ ath12k_pull_mac_phy_cap_svc_ready_ext(struct ath12k_wmi_pdev *wmi_handle, le32_to_cpu(mac_caps->he_ppet2g.ppet16_ppet8_ru3_ru0[i]); } - if (le32_to_cpu(mac_caps->supported_bands) & WMI_HOST_WLAN_5GHZ_CAP) { + if (supported_bands & WMI_HOST_WLAN_5GHZ_CAP) { cap_band = &pdev_cap->band[NL80211_BAND_5GHZ]; cap_band->phy_id = le32_to_cpu(mac_caps->phy_id); cap_band->max_bw_supported = -- 2.51.0