Skip to content

Commit bfc0ed7

Browse files
egrumbachjmberg-intel
authored andcommitted
Revert "wifi: iwlwifi: remove retry loops in start"
Revert commit dfdfe4b ("wifi: iwlwifi: remove retry loops in start"), it turns out that there's an issue with the PNVM load notification from firmware not getting processed, that this patch has been somewhat successfully papering over. Since this is being reported, revert the loop removal for now. We will later at least clean this up to only attempt to retry if there was a timeout, but currently we don't even bubble up the failure reason to the correct layer, only returning NULL. Fixes: dfdfe4b ("wifi: iwlwifi: remove retry loops in start") Signed-off-by: Emmanuel Grumbach <[email protected]> Link: https://patch.msgid.link/20241022092212.4aa82a558a00.Ibdeff9c8f0d608bc97fc42024392ae763b6937b7@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 734a377 commit bfc0ed7

File tree

3 files changed

+31
-10
lines changed

3 files changed

+31
-10
lines changed

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,25 +1413,35 @@ _iwl_op_mode_start(struct iwl_drv *drv, struct iwlwifi_opmode_table *op)
14131413
const struct iwl_op_mode_ops *ops = op->ops;
14141414
struct dentry *dbgfs_dir = NULL;
14151415
struct iwl_op_mode *op_mode = NULL;
1416+
int retry, max_retry = !!iwlwifi_mod_params.fw_restart * IWL_MAX_INIT_RETRY;
14161417

14171418
/* also protects start/stop from racing against each other */
14181419
lockdep_assert_held(&iwlwifi_opmode_table_mtx);
14191420

1421+
for (retry = 0; retry <= max_retry; retry++) {
1422+
14201423
#ifdef CONFIG_IWLWIFI_DEBUGFS
1421-
drv->dbgfs_op_mode = debugfs_create_dir(op->name,
1422-
drv->dbgfs_drv);
1423-
dbgfs_dir = drv->dbgfs_op_mode;
1424+
drv->dbgfs_op_mode = debugfs_create_dir(op->name,
1425+
drv->dbgfs_drv);
1426+
dbgfs_dir = drv->dbgfs_op_mode;
14241427
#endif
14251428

1426-
op_mode = ops->start(drv->trans, drv->trans->cfg,
1427-
&drv->fw, dbgfs_dir);
1428-
if (op_mode)
1429-
return op_mode;
1429+
op_mode = ops->start(drv->trans, drv->trans->cfg,
1430+
&drv->fw, dbgfs_dir);
1431+
1432+
if (op_mode)
1433+
return op_mode;
1434+
1435+
if (test_bit(STATUS_TRANS_DEAD, &drv->trans->status))
1436+
break;
1437+
1438+
IWL_ERR(drv, "retry init count %d\n", retry);
14301439

14311440
#ifdef CONFIG_IWLWIFI_DEBUGFS
1432-
debugfs_remove_recursive(drv->dbgfs_op_mode);
1433-
drv->dbgfs_op_mode = NULL;
1441+
debugfs_remove_recursive(drv->dbgfs_op_mode);
1442+
drv->dbgfs_op_mode = NULL;
14341443
#endif
1444+
}
14351445

14361446
return NULL;
14371447
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ void iwl_drv_stop(struct iwl_drv *drv);
9898
#define VISIBLE_IF_IWLWIFI_KUNIT static
9999
#endif
100100

101+
/* max retry for init flow */
102+
#define IWL_MAX_INIT_RETRY 2
103+
101104
#define FW_NAME_PRE_BUFSIZE 64
102105
struct iwl_trans;
103106
const char *iwl_drv_get_fwname_pre(struct iwl_trans *trans, char *buf);

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1293,20 +1293,28 @@ int iwl_mvm_mac_start(struct ieee80211_hw *hw)
12931293
{
12941294
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
12951295
int ret;
1296+
int retry, max_retry = 0;
12961297

12971298
mutex_lock(&mvm->mutex);
12981299

12991300
/* we are starting the mac not in error flow, and restart is enabled */
13001301
if (!test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, &mvm->status) &&
13011302
iwlwifi_mod_params.fw_restart) {
1303+
max_retry = IWL_MAX_INIT_RETRY;
13021304
/*
13031305
* This will prevent mac80211 recovery flows to trigger during
13041306
* init failures
13051307
*/
13061308
set_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
13071309
}
13081310

1309-
ret = __iwl_mvm_mac_start(mvm);
1311+
for (retry = 0; retry <= max_retry; retry++) {
1312+
ret = __iwl_mvm_mac_start(mvm);
1313+
if (!ret)
1314+
break;
1315+
1316+
IWL_ERR(mvm, "mac start retry %d\n", retry);
1317+
}
13101318
clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
13111319

13121320
mutex_unlock(&mvm->mutex);

0 commit comments

Comments
 (0)