Commit b8133439 authored by Avraham Stern's avatar Avraham Stern Committed by Gregory Greenman
Browse files

wifi: iwlwifi: mvm: trigger PCI re-enumeration in case of PLDR sync



When doing the PLDR flow, the fw goes through a re-read and needs
PCI re-enumeration in order to recover. In this case, skip the mac
start retry and fw dumps as all the fw and registers are invalid
until the PCI re-enumeration.

In addition, print the register that shows the re-read counter
when loading the fw.

Signed-off-by: default avatarAvraham Stern <avraham.stern@intel.com>
Link: https://lore.kernel.org/r/20221123225313.9ae77968961e.Ie06e886cef4b5921b65dacb7724db1276bed38cb@changeid


Signed-off-by: default avatarGregory Greenman <gregory.greenman@intel.com>
parent 0473cbae
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -368,6 +368,7 @@ enum {
#define CNVR_AUX_MISC_CHIP				0xA2B800
#define CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM		0xA29890
#define CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR	0xA29938
#define CNVI_SCU_SEQ_DATA_DW9				0xA27488

#define PREG_AUX_BUS_WPROT_0		0xA04CC0

+1 −0
Original line number Diff line number Diff line
@@ -1542,5 +1542,6 @@ void iwl_trans_free(struct iwl_trans *trans);
******************************************************/
int __must_check iwl_pci_register_driver(void);
void iwl_pci_unregister_driver(void);
void iwl_trans_pcie_remove(struct iwl_trans *trans, bool rescan);

#endif /* __iwl_trans_h__ */
+9 −3
Original line number Diff line number Diff line
@@ -364,6 +364,8 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
			 iwl_read_umac_prph(mvm->trans, WFPM_LMAC2_PD_NOTIFICATION));
		IWL_INFO(mvm, "WFPM_AUTH_KEY_0: 0x%x\n",
			 iwl_read_umac_prph(mvm->trans, SB_MODIFY_CFG_FLAG));
		IWL_INFO(mvm, "CNVI_SCU_SEQ_DATA_DW9: 0x%x\n",
			 iwl_read_prph(mvm->trans, CNVI_SCU_SEQ_DATA_DW9));
	}

	if (ret) {
@@ -402,7 +404,7 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
						UREG_LMAC2_CURRENT_PC));
		}

		if (ret == -ETIMEDOUT)
		if (ret == -ETIMEDOUT && !mvm->pldr_sync)
			iwl_fw_dbg_error_collect(&mvm->fwrt,
						 FW_DBG_TRIGGER_ALIVE_TIMEOUT);

@@ -1479,18 +1481,22 @@ int iwl_mvm_up(struct iwl_mvm *mvm)
		return ret;

	sb_cfg = iwl_read_umac_prph(mvm->trans, SB_MODIFY_CFG_FLAG);
	if (!(sb_cfg & SB_CFG_RESIDES_IN_OTP_MASK) && iwl_mei_pldr_req())
	mvm->pldr_sync = !(sb_cfg & SB_CFG_RESIDES_IN_OTP_MASK);
	if (mvm->pldr_sync && iwl_mei_pldr_req())
		return ret;

	ret = iwl_mvm_load_rt_fw(mvm);
	if (ret) {
		IWL_ERR(mvm, "Failed to start RT ucode: %d\n", ret);
		if (ret != -ERFKILL)
		if (ret != -ERFKILL && !mvm->pldr_sync)
			iwl_fw_dbg_error_collect(&mvm->fwrt,
						 FW_DBG_TRIGGER_DRIVER);
		goto error;
	}

	/* FW loaded successfully */
	mvm->pldr_sync = false;

	iwl_get_shared_mem_conf(&mvm->fwrt);

	ret = iwl_mvm_sf_update(mvm, NULL, false);
+10 −0
Original line number Diff line number Diff line
@@ -1068,6 +1068,16 @@ static int iwl_mvm_mac_start(struct ieee80211_hw *hw)
		if (!ret)
			break;

		/*
		 * In PLDR sync PCI re-enumeration is needed. no point to retry
		 * mac start before that.
		 */
		if (mvm->pldr_sync) {
			iwl_mei_alive_notif(false);
			iwl_trans_pcie_remove(mvm->trans, true);
			break;
		}

		IWL_ERR(mvm, "mac start retry %d\n", retry);
	}
	clear_bit(IWL_MVM_STATUS_STARTING, &mvm->status);
+2 −0
Original line number Diff line number Diff line
@@ -1105,6 +1105,8 @@ struct iwl_mvm {
	unsigned long last_reset_or_resume_time_jiffies;

	bool sta_remove_requires_queue_remove;

	bool pldr_sync;
};

/* Extract MVM priv from op_mode and _hw */
Loading