summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-12-28 01:58:21 +0400
committerJohannes Berg <johannes.berg@intel.com>2013-01-03 18:33:00 +0400
commit0aa86df673d2122fcffc43ed0266279e1b8d8204 (patch)
tree972837dccd252e075cf945866be1dc6bf688af74 /drivers/net/wireless/iwlwifi
parenta8b691e6104e6bd27070b6ed6622d0b640707fa8 (diff)
downloadlinux-0aa86df673d2122fcffc43ed0266279e1b8d8204.tar.xz
iwlwifi: move some PCIe calls to better places
Synchronizing the IRQ is pointless when we will then enable the RF-Kill interrupt again, but is needed before we free it and the data needed to handle IRQs; move it to the free function. Simiarly, cancelling the replenish work struct can move to the function that frees the RX data structures. Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c2
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/trans.c9
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index dad4c4aad91f..02c9016d9684 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -545,6 +545,8 @@ void iwl_pcie_rx_free(struct iwl_trans *trans)
return;
}
+ cancel_work_sync(&trans_pcie->rx_replenish);
+
spin_lock_irqsave(&rxq->lock, flags);
iwl_pcie_rxq_free_rbs(trans);
spin_unlock_irqrestore(&rxq->lock, flags);
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index 48cd65e950a1..bca620363037 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -534,12 +534,6 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans)
iwl_enable_rfkill_int(trans);
- /* wait to make sure we flush pending tasklet*/
- synchronize_irq(trans_pcie->pci_dev->irq);
- tasklet_kill(&trans_pcie->irq_tasklet);
-
- cancel_work_sync(&trans_pcie->rx_replenish);
-
/* stop and reset the on-board processor */
iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET);
@@ -682,6 +676,9 @@ void iwl_trans_pcie_free(struct iwl_trans *trans)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
+ synchronize_irq(trans_pcie->pci_dev->irq);
+ tasklet_kill(&trans_pcie->irq_tasklet);
+
iwl_pcie_tx_free(trans);
iwl_pcie_rx_free(trans);