aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorEliad Peller <eliad@wizery.com>2015-03-04 03:38:32 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-03-26 03:11:38 -0400
commit483f3ab1754f3c3698db622cc181249a0ca6372c (patch)
tree575cc16caf2b7e828ae2544515c62d050b1a13ff /drivers/net/wireless
parent4ffb36505c0d4e0909aa1812b0269eb181a51390 (diff)
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: Eliad Peller <eliadx.peller@intel.com> Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index df0022e72cd2..39e3cf06e364 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -964,7 +964,6 @@ static int iwl_pcie_load_given_ucode_8000b(struct iwl_trans *trans,
964static int iwl_trans_pcie_start_fw(struct iwl_trans *trans, 964static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
965 const struct fw_img *fw, bool run_in_rfkill) 965 const struct fw_img *fw, bool run_in_rfkill)
966{ 966{
967 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
968 int ret; 967 int ret;
969 bool hw_rfkill; 968 bool hw_rfkill;
970 969
@@ -994,9 +993,6 @@ static int iwl_trans_pcie_start_fw(struct iwl_trans *trans,
994 return ret; 993 return ret;
995 } 994 }
996 995
997 /* init ref_count to 1 (should be cleared when ucode is loaded) */
998 trans_pcie->ref_count = 1;
999
1000 /* make sure rfkill handshake bits are cleared */ 996 /* make sure rfkill handshake bits are cleared */
1001 iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL); 997 iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, CSR_UCODE_SW_BIT_RFKILL);
1002 iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR, 998 iwl_write32(trans, CSR_UCODE_DRV_GP1_CLR,
@@ -1315,6 +1311,9 @@ static void iwl_trans_pcie_configure(struct iwl_trans *trans,
1315 trans_pcie->bc_table_dword = trans_cfg->bc_table_dword; 1311 trans_pcie->bc_table_dword = trans_cfg->bc_table_dword;
1316 trans_pcie->scd_set_active = trans_cfg->scd_set_active; 1312 trans_pcie->scd_set_active = trans_cfg->scd_set_active;
1317 1313
1314 /* init ref_count to 1 (should be cleared when ucode is loaded) */
1315 trans_pcie->ref_count = 1;
1316
1318 /* Initialize NAPI here - it should be before registering to mac80211 1317 /* Initialize NAPI here - it should be before registering to mac80211
1319 * in the opmode but after the HW struct is allocated. 1318 * in the opmode but after the HW struct is allocated.
1320 * As this function may be called again in some corner cases don't 1319 * As this function may be called again in some corner cases don't