Commit 64dc5d5e authored by Miri Korenblit's avatar Miri Korenblit Committed by Johannes Berg
Browse files

Revert "wifi: iwlwifi: make no_160 more generic"



This reverts commit 75a3313f.

The indication of the BW limitation in the sub-device ID is not applicable
for Killer devices. For those devices, bw_limit will hold a random value,
so a matching dev_info might not be found, which leads to a probe
failure.
Until it is properly fixed, revert this.

Reported-by: default avatarTodd Brandt <todd.e.brandt@intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220029


Fixes: 75a3313f ("wifi: iwlwifi: make no_160 more generic")
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250420115541.36dd3007151e.I66b6b78db09bfea12ae84dd85603cf1583271474@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 72bb2725
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * Copyright (C) 2005-2014, 2018-2021 Intel Corporation
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 * Copyright (C) 2018-2025 Intel Corporation
 * Copyright (C) 2018-2024 Intel Corporation
 */
#ifndef __IWL_CONFIG_H__
#define __IWL_CONFIG_H__
@@ -451,8 +451,11 @@ struct iwl_cfg {
#define IWL_CFG_RF_ID_HR		0x7
#define IWL_CFG_RF_ID_HR1		0x4

#define IWL_CFG_BW_NO_LIM		(U16_MAX - 1)
#define IWL_CFG_BW_ANY			U16_MAX
#define IWL_CFG_NO_160			0x1
#define IWL_CFG_160			0x0

#define IWL_CFG_NO_320			0x1
#define IWL_CFG_320			0x0

#define IWL_CFG_CORES_BT		0x0
#define IWL_CFG_CORES_BT_GNSS		0x5
@@ -464,7 +467,7 @@ struct iwl_cfg {
#define IWL_CFG_IS_JACKET		0x1

#define IWL_SUBDEVICE_RF_ID(subdevice)	((u16)((subdevice) & 0x00F0) >> 4)
#define IWL_SUBDEVICE_BW_LIM(subdevice)	((u16)((subdevice) & 0x0200) >> 9)
#define IWL_SUBDEVICE_NO_160(subdevice)	((u16)((subdevice) & 0x0200) >> 9)
#define IWL_SUBDEVICE_CORES(subdevice)	((u16)((subdevice) & 0x1C00) >> 10)

struct iwl_dev_info {
@@ -472,10 +475,10 @@ struct iwl_dev_info {
	u16 subdevice;
	u16 mac_type;
	u16 rf_type;
	u16 bw_limit;
	u8 mac_step;
	u8 rf_step;
	u8 rf_id;
	u8 no_160;
	u8 cores;
	u8 cdb;
	u8 jacket;
@@ -489,7 +492,7 @@ extern const unsigned int iwl_dev_info_table_size;
const struct iwl_dev_info *
iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
		      u16 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
		      u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step);
		      u8 jacket, u8 rf_id, u8 no_160, u8 cores, u8 rf_step);
extern const struct pci_device_id iwl_hw_card_ids[];
#endif

+2 −2
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
 * Copyright (C) 2005-2014, 2018-2023, 2025 Intel Corporation
 * Copyright (C) 2005-2014, 2018-2023 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
@@ -1094,7 +1094,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
		iftype_data->eht_cap.eht_mcs_nss_supp.bw._320.rx_tx_mcs13_max_nss = 0;
	}

	if (trans->bw_limit < 160)
	if (trans->no_160)
		iftype_data->he_cap.he_cap_elem.phy_cap_info[0] &=
			~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;

+3 −4
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
 * Copyright (C) 2005-2014, 2018-2023, 2025 Intel Corporation
 * Copyright (C) 2005-2014, 2018-2023 Intel Corporation
 * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
 * Copyright (C) 2016-2017 Intel Deutschland GmbH
 */
@@ -876,7 +876,7 @@ struct iwl_txq {
 *	only valid for discrete (not integrated) NICs
 * @invalid_tx_cmd: invalid TX command buffer
 * @reduced_cap_sku: reduced capability supported SKU
 * @bw_limit: the max bandwidth
 * @no_160: device not supporting 160 MHz
 * @step_urm: STEP is in URM, no support for MCS>9 in 320 MHz
 * @restart: restart worker data
 * @restart.wk: restart worker
@@ -911,8 +911,7 @@ struct iwl_trans {
	char hw_id_str[52];
	u32 sku_id[3];
	bool reduced_cap_sku;
	u16 bw_limit;
	bool step_urm;
	u8 no_160:1, step_urm:1;

	u8 dsbr_urm_fw_dependent:1,
	   dsbr_urm_permanent:1;
+99 −107

File changed.

Preview size limit exceeded, changes collapsed.

+5 −10
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
/*
 * KUnit tests for the iwlwifi device info table
 *
 * Copyright (C) 2023-2025 Intel Corporation
 * Copyright (C) 2023-2024 Intel Corporation
 */
#include <kunit/test.h>
#include <linux/pci.h>
@@ -13,9 +13,9 @@ MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");

static void iwl_pci_print_dev_info(const char *pfx, const struct iwl_dev_info *di)
{
	printk(KERN_DEBUG "%sdev=%.4x,subdev=%.4x,mac_type=%.4x,mac_step=%.4x,rf_type=%.4x,cdb=%d,jacket=%d,rf_id=%.2x,bw_limit=%d,cores=%.2x\n",
	printk(KERN_DEBUG "%sdev=%.4x,subdev=%.4x,mac_type=%.4x,mac_step=%.4x,rf_type=%.4x,cdb=%d,jacket=%d,rf_id=%.2x,no_160=%d,cores=%.2x\n",
	       pfx, di->device, di->subdevice, di->mac_type, di->mac_step,
	       di->rf_type, di->cdb, di->jacket, di->rf_id, di->bw_limit,
	       di->rf_type, di->cdb, di->jacket, di->rf_id, di->no_160,
	       di->cores);
}

@@ -31,13 +31,8 @@ static void devinfo_table_order(struct kunit *test)
					    di->mac_type, di->mac_step,
					    di->rf_type, di->cdb,
					    di->jacket, di->rf_id,
					    di->bw_limit != IWL_CFG_BW_NO_LIM,
					    di->cores, di->rf_step);
		if (!ret) {
			iwl_pci_print_dev_info("No entry found for: ", di);
			KUNIT_FAIL(test,
				   "No entry found for entry at index %d\n", idx);
		} else if (ret != di) {
					    di->no_160, di->cores, di->rf_step);
		if (ret != di) {
			iwl_pci_print_dev_info("searched: ", di);
			iwl_pci_print_dev_info("found:    ", ret);
			KUNIT_FAIL(test,