Skip to content

Commit 30763f1

Browse files
committed
Johannes Berg says: ==================== Some more fixes, notably: * iwlwifi: various regression and iwlmld fixes * mac80211: fix TX frames in monitor mode * brcmfmac: error handling for firmware load * tag 'wireless-2025-04-24' of https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: iwlwifi: restore missing initialization of async_handlers_list wifi: brcm80211: fmac: Add error handling for brcmf_usb_dl_writeimage() wifi: plfxlc: Remove erroneous assert in plfxlc_mac_release wifi: iwlwifi: fix the check for the SCRATCH register upon resume wifi: iwlwifi: don't warn if the NIC is gone in resume wifi: iwlwifi: mld: fix BAID validity check wifi: iwlwifi: back off on continuous errors wifi: iwlwifi: mld: only create debugfs symlink if it does not exist wifi: iwlwifi: mld: inform trans on init failure wifi: iwlwifi: mld: properly handle async notification in op mode start Revert "wifi: iwlwifi: make no_160 more generic" Revert "wifi: iwlwifi: add support for BE213" wifi: mac80211: restore monitor for outgoing frames ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents e72e9e6 + 175e69e commit 30763f1

File tree

20 files changed

+224
-196
lines changed

20 files changed

+224
-196
lines changed

drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,14 +896,16 @@ brcmf_usb_dl_writeimage(struct brcmf_usbdev_info *devinfo, u8 *fw, int fwlen)
896896
}
897897

898898
/* 1) Prepare USB boot loader for runtime image */
899-
brcmf_usb_dl_cmd(devinfo, DL_START, &state, sizeof(state));
899+
err = brcmf_usb_dl_cmd(devinfo, DL_START, &state, sizeof(state));
900+
if (err)
901+
goto fail;
900902

901903
rdlstate = le32_to_cpu(state.state);
902904
rdlbytes = le32_to_cpu(state.bytes);
903905

904906
/* 2) Check we are in the Waiting state */
905907
if (rdlstate != DL_WAITING) {
906-
brcmf_err("Failed to DL_START\n");
908+
brcmf_err("Invalid DL state: %u\n", rdlstate);
907909
err = -EINVAL;
908910
goto fail;
909911
}

drivers/net/wireless/intel/iwlwifi/cfg/sc.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ const struct iwl_cfg_trans_params iwl_sc_trans_cfg = {
142142
.ltr_delay = IWL_CFG_TRANS_LTR_DELAY_2500US,
143143
};
144144

145-
const char iwl_sp_name[] = "Intel(R) Wi-Fi 7 BE213 160MHz";
146-
147145
const struct iwl_cfg iwl_cfg_sc = {
148146
.fw_name_mac = "sc",
149147
IWL_DEVICE_SC,

drivers/net/wireless/intel/iwlwifi/iwl-config.h

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Copyright (C) 2005-2014, 2018-2021 Intel Corporation
44
* Copyright (C) 2016-2017 Intel Deutschland GmbH
5-
* Copyright (C) 2018-2025 Intel Corporation
5+
* Copyright (C) 2018-2024 Intel Corporation
66
*/
77
#ifndef __IWL_CONFIG_H__
88
#define __IWL_CONFIG_H__
@@ -451,8 +451,11 @@ struct iwl_cfg {
451451
#define IWL_CFG_RF_ID_HR 0x7
452452
#define IWL_CFG_RF_ID_HR1 0x4
453453

454-
#define IWL_CFG_BW_NO_LIM (U16_MAX - 1)
455-
#define IWL_CFG_BW_ANY U16_MAX
454+
#define IWL_CFG_NO_160 0x1
455+
#define IWL_CFG_160 0x0
456+
457+
#define IWL_CFG_NO_320 0x1
458+
#define IWL_CFG_320 0x0
456459

457460
#define IWL_CFG_CORES_BT 0x0
458461
#define IWL_CFG_CORES_BT_GNSS 0x5
@@ -464,18 +467,18 @@ struct iwl_cfg {
464467
#define IWL_CFG_IS_JACKET 0x1
465468

466469
#define IWL_SUBDEVICE_RF_ID(subdevice) ((u16)((subdevice) & 0x00F0) >> 4)
467-
#define IWL_SUBDEVICE_BW_LIM(subdevice) ((u16)((subdevice) & 0x0200) >> 9)
470+
#define IWL_SUBDEVICE_NO_160(subdevice) ((u16)((subdevice) & 0x0200) >> 9)
468471
#define IWL_SUBDEVICE_CORES(subdevice) ((u16)((subdevice) & 0x1C00) >> 10)
469472

470473
struct iwl_dev_info {
471474
u16 device;
472475
u16 subdevice;
473476
u16 mac_type;
474477
u16 rf_type;
475-
u16 bw_limit;
476478
u8 mac_step;
477479
u8 rf_step;
478480
u8 rf_id;
481+
u8 no_160;
479482
u8 cores;
480483
u8 cdb;
481484
u8 jacket;
@@ -489,7 +492,7 @@ extern const unsigned int iwl_dev_info_table_size;
489492
const struct iwl_dev_info *
490493
iwl_pci_find_dev_info(u16 device, u16 subsystem_device,
491494
u16 mac_type, u8 mac_step, u16 rf_type, u8 cdb,
492-
u8 jacket, u8 rf_id, u8 bw_limit, u8 cores, u8 rf_step);
495+
u8 jacket, u8 rf_id, u8 no_160, u8 cores, u8 rf_step);
493496
extern const struct pci_device_id iwl_hw_card_ids[];
494497
#endif
495498

@@ -550,7 +553,6 @@ extern const char iwl_ax231_name[];
550553
extern const char iwl_ax411_name[];
551554
extern const char iwl_fm_name[];
552555
extern const char iwl_wh_name[];
553-
extern const char iwl_sp_name[];
554556
extern const char iwl_gl_name[];
555557
extern const char iwl_mtp_name[];
556558
extern const char iwl_dr_name[];

drivers/net/wireless/intel/iwlwifi/iwl-csr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
* during a error FW error.
149149
*/
150150
#define CSR_FUNC_SCRATCH_INIT_VALUE (0x01010101)
151+
#define CSR_FUNC_SCRATCH_POWER_OFF_MASK 0xFFFF
151152

152153
/* Bits for CSR_HW_IF_CONFIG_REG */
153154
#define CSR_HW_IF_CONFIG_REG_MSK_MAC_STEP_DASH (0x0000000F)

drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2005-2014, 2018-2023, 2025 Intel Corporation
3+
* Copyright (C) 2005-2014, 2018-2023 Intel Corporation
44
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
55
* Copyright (C) 2016-2017 Intel Deutschland GmbH
66
*/
@@ -944,8 +944,7 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
944944
IEEE80211_EHT_MAC_CAP0_MAX_MPDU_LEN_MASK);
945945
break;
946946
case NL80211_BAND_6GHZ:
947-
if (!trans->reduced_cap_sku &&
948-
trans->bw_limit >= 320) {
947+
if (!trans->reduced_cap_sku) {
949948
iftype_data->eht_cap.eht_cap_elem.phy_cap_info[0] |=
950949
IEEE80211_EHT_PHY_CAP0_320MHZ_IN_6GHZ;
951950
iftype_data->eht_cap.eht_cap_elem.phy_cap_info[1] |=
@@ -1095,22 +1094,19 @@ iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
10951094
iftype_data->eht_cap.eht_mcs_nss_supp.bw._320.rx_tx_mcs13_max_nss = 0;
10961095
}
10971096

1098-
if (trans->bw_limit < 160)
1097+
if (trans->no_160)
10991098
iftype_data->he_cap.he_cap_elem.phy_cap_info[0] &=
11001099
~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G;
11011100

1102-
if (trans->bw_limit < 320 || trans->reduced_cap_sku) {
1101+
if (trans->reduced_cap_sku) {
11031102
memset(&iftype_data->eht_cap.eht_mcs_nss_supp.bw._320, 0,
11041103
sizeof(iftype_data->eht_cap.eht_mcs_nss_supp.bw._320));
1105-
iftype_data->eht_cap.eht_cap_elem.phy_cap_info[2] &=
1106-
~IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK;
1107-
}
1108-
1109-
if (trans->reduced_cap_sku) {
11101104
iftype_data->eht_cap.eht_mcs_nss_supp.bw._80.rx_tx_mcs13_max_nss = 0;
11111105
iftype_data->eht_cap.eht_mcs_nss_supp.bw._160.rx_tx_mcs13_max_nss = 0;
11121106
iftype_data->eht_cap.eht_cap_elem.phy_cap_info[8] &=
11131107
~IEEE80211_EHT_PHY_CAP8_RX_4096QAM_WIDER_BW_DL_OFDMA;
1108+
iftype_data->eht_cap.eht_cap_elem.phy_cap_info[2] &=
1109+
~IEEE80211_EHT_PHY_CAP2_SOUNDING_DIM_320MHZ_MASK;
11141110
}
11151111
}
11161112

drivers/net/wireless/intel/iwlwifi/iwl-trans.c

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ struct iwl_trans_dev_restart_data {
2121
struct list_head list;
2222
unsigned int restart_count;
2323
time64_t last_error;
24+
bool backoff;
2425
char name[];
2526
};
2627

@@ -125,13 +126,20 @@ iwl_trans_determine_restart_mode(struct iwl_trans *trans)
125126
if (!data)
126127
return at_least;
127128

128-
if (ktime_get_boottime_seconds() - data->last_error >=
129+
if (!data->backoff &&
130+
ktime_get_boottime_seconds() - data->last_error >=
129131
IWL_TRANS_RESET_OK_TIME)
130132
data->restart_count = 0;
131133

132134
index = data->restart_count;
133-
if (index >= ARRAY_SIZE(escalation_list))
135+
if (index >= ARRAY_SIZE(escalation_list)) {
134136
index = ARRAY_SIZE(escalation_list) - 1;
137+
if (!data->backoff) {
138+
data->backoff = true;
139+
return IWL_RESET_MODE_BACKOFF;
140+
}
141+
data->backoff = false;
142+
}
135143

136144
return max(at_least, escalation_list[index]);
137145
}
@@ -140,7 +148,8 @@ iwl_trans_determine_restart_mode(struct iwl_trans *trans)
140148

141149
static void iwl_trans_restart_wk(struct work_struct *wk)
142150
{
143-
struct iwl_trans *trans = container_of(wk, typeof(*trans), restart.wk);
151+
struct iwl_trans *trans = container_of(wk, typeof(*trans),
152+
restart.wk.work);
144153
struct iwl_trans_reprobe *reprobe;
145154
enum iwl_reset_mode mode;
146155

@@ -168,6 +177,12 @@ static void iwl_trans_restart_wk(struct work_struct *wk)
168177
return;
169178

170179
mode = iwl_trans_determine_restart_mode(trans);
180+
if (mode == IWL_RESET_MODE_BACKOFF) {
181+
IWL_ERR(trans, "Too many device errors - delay next reset\n");
182+
queue_delayed_work(system_unbound_wq, &trans->restart.wk,
183+
IWL_TRANS_RESET_DELAY);
184+
return;
185+
}
171186

172187
iwl_trans_inc_restart_count(trans->dev);
173188

@@ -227,7 +242,7 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
227242
trans->dev = dev;
228243
trans->num_rx_queues = 1;
229244

230-
INIT_WORK(&trans->restart.wk, iwl_trans_restart_wk);
245+
INIT_DELAYED_WORK(&trans->restart.wk, iwl_trans_restart_wk);
231246

232247
return trans;
233248
}
@@ -271,7 +286,7 @@ int iwl_trans_init(struct iwl_trans *trans)
271286

272287
void iwl_trans_free(struct iwl_trans *trans)
273288
{
274-
cancel_work_sync(&trans->restart.wk);
289+
cancel_delayed_work_sync(&trans->restart.wk);
275290
kmem_cache_destroy(trans->dev_cmd_pool);
276291
}
277292

@@ -403,7 +418,7 @@ void iwl_trans_op_mode_leave(struct iwl_trans *trans)
403418

404419
iwl_trans_pcie_op_mode_leave(trans);
405420

406-
cancel_work_sync(&trans->restart.wk);
421+
cancel_delayed_work_sync(&trans->restart.wk);
407422

408423
trans->op_mode = NULL;
409424

@@ -540,7 +555,6 @@ void __releases(nic_access)
540555
iwl_trans_release_nic_access(struct iwl_trans *trans)
541556
{
542557
iwl_trans_pcie_release_nic_access(trans);
543-
__release(nic_access);
544558
}
545559
IWL_EXPORT_SYMBOL(iwl_trans_release_nic_access);
546560

drivers/net/wireless/intel/iwlwifi/iwl-trans.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
22
/*
3-
* Copyright (C) 2005-2014, 2018-2023, 2025 Intel Corporation
3+
* Copyright (C) 2005-2014, 2018-2023 Intel Corporation
44
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
55
* Copyright (C) 2016-2017 Intel Deutschland GmbH
66
*/
@@ -876,7 +876,7 @@ struct iwl_txq {
876876
* only valid for discrete (not integrated) NICs
877877
* @invalid_tx_cmd: invalid TX command buffer
878878
* @reduced_cap_sku: reduced capability supported SKU
879-
* @bw_limit: the max bandwidth
879+
* @no_160: device not supporting 160 MHz
880880
* @step_urm: STEP is in URM, no support for MCS>9 in 320 MHz
881881
* @restart: restart worker data
882882
* @restart.wk: restart worker
@@ -911,8 +911,7 @@ struct iwl_trans {
911911
char hw_id_str[52];
912912
u32 sku_id[3];
913913
bool reduced_cap_sku;
914-
u16 bw_limit;
915-
bool step_urm;
914+
u8 no_160:1, step_urm:1;
916915

917916
u8 dsbr_urm_fw_dependent:1,
918917
dsbr_urm_permanent:1;
@@ -962,7 +961,7 @@ struct iwl_trans {
962961
struct iwl_dma_ptr invalid_tx_cmd;
963962

964963
struct {
965-
struct work_struct wk;
964+
struct delayed_work wk;
966965
struct iwl_fw_error_dump_mode mode;
967966
bool during_reset;
968967
} restart;
@@ -1163,7 +1162,7 @@ static inline void iwl_trans_schedule_reset(struct iwl_trans *trans,
11631162
*/
11641163
trans->restart.during_reset = test_bit(STATUS_IN_SW_RESET,
11651164
&trans->status);
1166-
queue_work(system_unbound_wq, &trans->restart.wk);
1165+
queue_delayed_work(system_unbound_wq, &trans->restart.wk, 0);
11671166
}
11681167

11691168
static inline void iwl_trans_fw_error(struct iwl_trans *trans,
@@ -1262,6 +1261,9 @@ enum iwl_reset_mode {
12621261
IWL_RESET_MODE_RESCAN,
12631262
IWL_RESET_MODE_FUNC_RESET,
12641263
IWL_RESET_MODE_PROD_RESET,
1264+
1265+
/* keep last - special backoff value */
1266+
IWL_RESET_MODE_BACKOFF,
12651267
};
12661268

12671269
void iwl_trans_pcie_reset(struct iwl_trans *trans, enum iwl_reset_mode mode);

drivers/net/wireless/intel/iwlwifi/mld/agg.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ void iwl_mld_handle_bar_frame_release_notif(struct iwl_mld *mld,
124124

125125
rcu_read_lock();
126126
baid_data = rcu_dereference(mld->fw_id_to_ba[baid]);
127-
if (!IWL_FW_CHECK(mld, !baid_data,
128-
"Got valid BAID %d but not allocated, invalid BAR release!\n",
129-
baid))
127+
if (IWL_FW_CHECK(mld, !baid_data,
128+
"Got valid BAID %d but not allocated, invalid BAR release!\n",
129+
baid))
130130
goto out_unlock;
131131

132132
if (IWL_FW_CHECK(mld, tid != baid_data->tid ||

drivers/net/wireless/intel/iwlwifi/mld/debugfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,9 @@ void iwl_mld_add_vif_debugfs(struct ieee80211_hw *hw,
949949
snprintf(name, sizeof(name), "%pd", vif->debugfs_dir);
950950
snprintf(target, sizeof(target), "../../../%pd3/iwlmld",
951951
vif->debugfs_dir);
952-
mld_vif->dbgfs_slink =
953-
debugfs_create_symlink(name, mld->debugfs_dir, target);
952+
if (!mld_vif->dbgfs_slink)
953+
mld_vif->dbgfs_slink =
954+
debugfs_create_symlink(name, mld->debugfs_dir, target);
954955

955956
if (iwlmld_mod_params.power_scheme != IWL_POWER_SCHEME_CAM &&
956957
vif->type == NL80211_IFTYPE_STATION) {

drivers/net/wireless/intel/iwlwifi/mld/fw.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,19 +333,22 @@ int iwl_mld_load_fw(struct iwl_mld *mld)
333333

334334
ret = iwl_trans_start_hw(mld->trans);
335335
if (ret)
336-
return ret;
336+
goto err;
337337

338338
ret = iwl_mld_run_fw_init_sequence(mld);
339339
if (ret)
340-
return ret;
340+
goto err;
341341

342342
ret = iwl_mld_init_mcc(mld);
343343
if (ret)
344-
return ret;
344+
goto err;
345345

346346
mld->fw_status.running = true;
347347

348348
return 0;
349+
err:
350+
iwl_mld_stop_fw(mld);
351+
return ret;
349352
}
350353

351354
void iwl_mld_stop_fw(struct iwl_mld *mld)
@@ -358,6 +361,10 @@ void iwl_mld_stop_fw(struct iwl_mld *mld)
358361

359362
iwl_trans_stop_device(mld->trans);
360363

364+
wiphy_work_cancel(mld->wiphy, &mld->async_handlers_wk);
365+
366+
iwl_mld_purge_async_handlers_list(mld);
367+
361368
mld->fw_status.running = false;
362369
}
363370

drivers/net/wireless/intel/iwlwifi/mld/mac80211.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ void iwl_mld_mac80211_remove_interface(struct ieee80211_hw *hw,
651651

652652
#ifdef CONFIG_IWLWIFI_DEBUGFS
653653
debugfs_remove(iwl_mld_vif_from_mac80211(vif)->dbgfs_slink);
654+
iwl_mld_vif_from_mac80211(vif)->dbgfs_slink = NULL;
654655
#endif
655656

656657
iwl_mld_rm_vif(mld, vif);

drivers/net/wireless/intel/iwlwifi/mld/mld.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ void iwl_construct_mld(struct iwl_mld *mld, struct iwl_trans *trans,
7575

7676
/* Setup async RX handling */
7777
spin_lock_init(&mld->async_handlers_lock);
78+
INIT_LIST_HEAD(&mld->async_handlers_list);
7879
wiphy_work_init(&mld->async_handlers_wk,
7980
iwl_mld_async_handlers_wk);
8081

@@ -414,9 +415,14 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
414415
wiphy_unlock(mld->wiphy);
415416
rtnl_unlock();
416417
iwl_fw_flush_dumps(&mld->fwrt);
417-
goto free_hw;
418+
goto err;
418419
}
419420

421+
/* We are about to stop the FW. Notifications may require an
422+
* operational FW, so handle them all here before we stop.
423+
*/
424+
wiphy_work_flush(mld->wiphy, &mld->async_handlers_wk);
425+
420426
iwl_mld_stop_fw(mld);
421427

422428
wiphy_unlock(mld->wiphy);
@@ -455,7 +461,8 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
455461
iwl_mld_leds_exit(mld);
456462
free_nvm:
457463
kfree(mld->nvm_data);
458-
free_hw:
464+
err:
465+
iwl_trans_op_mode_leave(mld->trans);
459466
ieee80211_free_hw(mld->hw);
460467
return ERR_PTR(ret);
461468
}

0 commit comments

Comments
 (0)