Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 483f3ab1 authored by Eliad Peller's avatar Eliad Peller Committed by Emmanuel Grumbach
Browse files

iwlwifi: pcie: initialize trans_pcie->ref_count on configure()



ref_count is currently initialized on start_fw(). This causes
some issues in restart flow, as currently active references
(e.g. unclaimed command) will get cleared, resulting in
invalid reference accounting.

Move the ref_count initialization to the configure() trans op,
so it won't be re-initialized on restart.

Signed-off-by: default avatarEliad Peller <eliadx.peller@intel.com>
Reviewed-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarEmmanuel Grumbach <emmanuel.grumbach@intel.com>
parent 4ffb3650
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -964,7 +964,6 @@ static int iwl_pcie_load_given_ucode_8000b(struct iwl_trans *trans,
static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
				   const struct fw_img *fw, bool run_in_rfkill)
				   const struct fw_img *fw, bool run_in_rfkill)
{
{
	struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
	int ret;
	int ret;
	bool hw_rfkill;
	bool hw_rfkill;


@@ -994,9 +993,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
		return ret;
		return ret;
	}
	}


	/* init ref_count to 1 (should be cleared when ucode is loaded) */
	trans_pcie->ref_count = 1;

	/* make sure rfkill handshake bits are cleared */
	/* make sure rfkill handshake bits are cleared */
	iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
	iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
	iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR,
	iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR,
@@ -1315,6 +1311,9 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans,
	trans_pcie->bc_table_dword = trans_cfg->bc_table_dword;
	trans_pcie->bc_table_dword = trans_cfg->bc_table_dword;
	trans_pcie->scd_set_active = trans_cfg->scd_set_active;
	trans_pcie->scd_set_active = trans_cfg->scd_set_active;


	/* init ref_count to 1 (should be cleared when ucode is loaded) */
	trans_pcie->ref_count = 1;

	/* Initialize NAPI here - it should be before registering to mac80211
	/* Initialize NAPI here - it should be before registering to mac80211
	 * in the opmode but after the HW struct is allocated.
	 * in the opmode but after the HW struct is allocated.
	 * As this function may be called again in some corner cases don't
	 * As this function may be called again in some corner cases don't