diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-11 03:22:28 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-21 14:23:03 -0500 |
commit | 7b70bd63c61d17a05a03bfc2f4eb83c1200a2509 (patch) | |
tree | 309e8b738b833edc0ce9ac7616848337a4ca219b /drivers/net | |
parent | 7ba1faa45f5d1ea2ddd36c6d5f59a81fea611d92 (diff) |
iwlwifi: pcie: use don't disable interrupt when irq_lock is taken
Since we don't take this lock in the primary interrupt
handler, there is no pointin disabling the interrupt
in the critical section protected by trans_pcie->irq_lock.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/rx.c | 28 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/trans.c | 23 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 10 |
3 files changed, 26 insertions, 35 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 2e11512ca353..7ab510e4be41 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -379,13 +379,12 @@ static void iwl_pcie_rxq_free_rbs(struct iwl_trans *trans) | |||
379 | static void iwl_pcie_rx_replenish(struct iwl_trans *trans) | 379 | static void iwl_pcie_rx_replenish(struct iwl_trans *trans) |
380 | { | 380 | { |
381 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 381 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
382 | unsigned long flags; | ||
383 | 382 | ||
384 | iwl_pcie_rxq_alloc_rbs(trans, GFP_KERNEL); | 383 | iwl_pcie_rxq_alloc_rbs(trans, GFP_KERNEL); |
385 | 384 | ||
386 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 385 | spin_lock(&trans_pcie->irq_lock); |
387 | iwl_pcie_rxq_restock(trans); | 386 | iwl_pcie_rxq_restock(trans); |
388 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 387 | spin_unlock(&trans_pcie->irq_lock); |
389 | } | 388 | } |
390 | 389 | ||
391 | static void iwl_pcie_rx_replenish_now(struct iwl_trans *trans) | 390 | static void iwl_pcie_rx_replenish_now(struct iwl_trans *trans) |
@@ -541,10 +540,10 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) | |||
541 | 540 | ||
542 | iwl_pcie_rx_hw_init(trans, rxq); | 541 | iwl_pcie_rx_hw_init(trans, rxq); |
543 | 542 | ||
544 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 543 | spin_lock(&trans_pcie->irq_lock); |
545 | rxq->need_update = 1; | 544 | rxq->need_update = 1; |
546 | iwl_pcie_rxq_inc_wr_ptr(trans, rxq); | 545 | iwl_pcie_rxq_inc_wr_ptr(trans, rxq); |
547 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 546 | spin_unlock(&trans_pcie->irq_lock); |
548 | 547 | ||
549 | return 0; | 548 | return 0; |
550 | } | 549 | } |
@@ -895,12 +894,11 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
895 | struct isr_statistics *isr_stats = &trans_pcie->isr_stats; | 894 | struct isr_statistics *isr_stats = &trans_pcie->isr_stats; |
896 | u32 inta = 0; | 895 | u32 inta = 0; |
897 | u32 handled = 0; | 896 | u32 handled = 0; |
898 | unsigned long flags; | ||
899 | u32 i; | 897 | u32 i; |
900 | 898 | ||
901 | lock_map_acquire(&trans->sync_cmd_lockdep_map); | 899 | lock_map_acquire(&trans->sync_cmd_lockdep_map); |
902 | 900 | ||
903 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 901 | spin_lock(&trans_pcie->irq_lock); |
904 | 902 | ||
905 | /* dram interrupt table not set yet, | 903 | /* dram interrupt table not set yet, |
906 | * use legacy interrupt. | 904 | * use legacy interrupt. |
@@ -937,7 +935,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
937 | */ | 935 | */ |
938 | if (test_bit(STATUS_INT_ENABLED, &trans->status)) | 936 | if (test_bit(STATUS_INT_ENABLED, &trans->status)) |
939 | iwl_enable_interrupts(trans); | 937 | iwl_enable_interrupts(trans); |
940 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 938 | spin_unlock(&trans_pcie->irq_lock); |
941 | lock_map_release(&trans->sync_cmd_lockdep_map); | 939 | lock_map_release(&trans->sync_cmd_lockdep_map); |
942 | return IRQ_NONE; | 940 | return IRQ_NONE; |
943 | } | 941 | } |
@@ -948,7 +946,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
948 | * already raised an interrupt. | 946 | * already raised an interrupt. |
949 | */ | 947 | */ |
950 | IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | 948 | IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta); |
951 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 949 | spin_unlock(&trans_pcie->irq_lock); |
952 | goto out; | 950 | goto out; |
953 | } | 951 | } |
954 | 952 | ||
@@ -969,7 +967,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
969 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", | 967 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", |
970 | inta, iwl_read32(trans, CSR_INT_MASK)); | 968 | inta, iwl_read32(trans, CSR_INT_MASK)); |
971 | 969 | ||
972 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 970 | spin_unlock(&trans_pcie->irq_lock); |
973 | 971 | ||
974 | /* Now service all interrupt bits discovered above. */ | 972 | /* Now service all interrupt bits discovered above. */ |
975 | if (inta & CSR_INT_BIT_HW_ERR) { | 973 | if (inta & CSR_INT_BIT_HW_ERR) { |
@@ -1194,12 +1192,11 @@ void iwl_pcie_reset_ict(struct iwl_trans *trans) | |||
1194 | { | 1192 | { |
1195 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1193 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1196 | u32 val; | 1194 | u32 val; |
1197 | unsigned long flags; | ||
1198 | 1195 | ||
1199 | if (!trans_pcie->ict_tbl) | 1196 | if (!trans_pcie->ict_tbl) |
1200 | return; | 1197 | return; |
1201 | 1198 | ||
1202 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 1199 | spin_lock(&trans_pcie->irq_lock); |
1203 | iwl_disable_interrupts(trans); | 1200 | iwl_disable_interrupts(trans); |
1204 | 1201 | ||
1205 | memset(trans_pcie->ict_tbl, 0, ICT_SIZE); | 1202 | memset(trans_pcie->ict_tbl, 0, ICT_SIZE); |
@@ -1216,18 +1213,17 @@ void iwl_pcie_reset_ict(struct iwl_trans *trans) | |||
1216 | trans_pcie->ict_index = 0; | 1213 | trans_pcie->ict_index = 0; |
1217 | iwl_write32(trans, CSR_INT, trans_pcie->inta_mask); | 1214 | iwl_write32(trans, CSR_INT, trans_pcie->inta_mask); |
1218 | iwl_enable_interrupts(trans); | 1215 | iwl_enable_interrupts(trans); |
1219 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 1216 | spin_unlock(&trans_pcie->irq_lock); |
1220 | } | 1217 | } |
1221 | 1218 | ||
1222 | /* Device is going down disable ict interrupt usage */ | 1219 | /* Device is going down disable ict interrupt usage */ |
1223 | void iwl_pcie_disable_ict(struct iwl_trans *trans) | 1220 | void iwl_pcie_disable_ict(struct iwl_trans *trans) |
1224 | { | 1221 | { |
1225 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1222 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1226 | unsigned long flags; | ||
1227 | 1223 | ||
1228 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 1224 | spin_lock(&trans_pcie->irq_lock); |
1229 | trans_pcie->use_ict = false; | 1225 | trans_pcie->use_ict = false; |
1230 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 1226 | spin_unlock(&trans_pcie->irq_lock); |
1231 | } | 1227 | } |
1232 | 1228 | ||
1233 | irqreturn_t iwl_pcie_isr(int irq, void *data) | 1229 | irqreturn_t iwl_pcie_isr(int irq, void *data) |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index 721050735ee6..9a07cf3062ea 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -271,13 +271,12 @@ static void iwl_pcie_apm_stop(struct iwl_trans *trans) | |||
271 | static int iwl_pcie_nic_init(struct iwl_trans *trans) | 271 | static int iwl_pcie_nic_init(struct iwl_trans *trans) |
272 | { | 272 | { |
273 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 273 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
274 | unsigned long flags; | ||
275 | 274 | ||
276 | /* nic_init */ | 275 | /* nic_init */ |
277 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 276 | spin_lock(&trans_pcie->irq_lock); |
278 | iwl_pcie_apm_init(trans); | 277 | iwl_pcie_apm_init(trans); |
279 | 278 | ||
280 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 279 | spin_unlock(&trans_pcie->irq_lock); |
281 | 280 | ||
282 | iwl_pcie_set_pwr(trans, false); | 281 | iwl_pcie_set_pwr(trans, false); |
283 | 282 | ||
@@ -635,13 +634,12 @@ static void iwl_trans_pcie_fw_alive(struct iwl_trans *trans, u32 scd_addr) | |||
635 | static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) | 634 | static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) |
636 | { | 635 | { |
637 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 636 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
638 | unsigned long flags; | ||
639 | bool hw_rfkill; | 637 | bool hw_rfkill; |
640 | 638 | ||
641 | /* tell the device to stop sending interrupts */ | 639 | /* tell the device to stop sending interrupts */ |
642 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 640 | spin_lock(&trans_pcie->irq_lock); |
643 | iwl_disable_interrupts(trans); | 641 | iwl_disable_interrupts(trans); |
644 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 642 | spin_unlock(&trans_pcie->irq_lock); |
645 | 643 | ||
646 | /* device going down, Stop using ICT table */ | 644 | /* device going down, Stop using ICT table */ |
647 | iwl_pcie_disable_ict(trans); | 645 | iwl_pcie_disable_ict(trans); |
@@ -673,9 +671,9 @@ static void iwl_trans_pcie_stop_device(struct iwl_trans *trans) | |||
673 | /* Upon stop, the APM issues an interrupt if HW RF kill is set. | 671 | /* Upon stop, the APM issues an interrupt if HW RF kill is set. |
674 | * Clean again the interrupt here | 672 | * Clean again the interrupt here |
675 | */ | 673 | */ |
676 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 674 | spin_lock(&trans_pcie->irq_lock); |
677 | iwl_disable_interrupts(trans); | 675 | iwl_disable_interrupts(trans); |
678 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 676 | spin_unlock(&trans_pcie->irq_lock); |
679 | 677 | ||
680 | /* stop and reset the on-board processor */ | 678 | /* stop and reset the on-board processor */ |
681 | iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); | 679 | iwl_write32(trans, CSR_RESET, CSR_RESET_REG_FLAG_NEVO_RESET); |
@@ -821,18 +819,17 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans) | |||
821 | static void iwl_trans_pcie_op_mode_leave(struct iwl_trans *trans) | 819 | static void iwl_trans_pcie_op_mode_leave(struct iwl_trans *trans) |
822 | { | 820 | { |
823 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 821 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
824 | unsigned long flags; | ||
825 | 822 | ||
826 | /* disable interrupts - don't enable HW RF kill interrupt */ | 823 | /* disable interrupts - don't enable HW RF kill interrupt */ |
827 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 824 | spin_lock(&trans_pcie->irq_lock); |
828 | iwl_disable_interrupts(trans); | 825 | iwl_disable_interrupts(trans); |
829 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 826 | spin_unlock(&trans_pcie->irq_lock); |
830 | 827 | ||
831 | iwl_pcie_apm_stop(trans); | 828 | iwl_pcie_apm_stop(trans); |
832 | 829 | ||
833 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 830 | spin_lock(&trans_pcie->irq_lock); |
834 | iwl_disable_interrupts(trans); | 831 | iwl_disable_interrupts(trans); |
835 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 832 | spin_unlock(&trans_pcie->irq_lock); |
836 | 833 | ||
837 | iwl_pcie_disable_ict(trans); | 834 | iwl_pcie_disable_ict(trans); |
838 | } | 835 | } |
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index 8df24787c141..b49a185355e4 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -737,10 +737,9 @@ int iwl_pcie_tx_stop(struct iwl_trans *trans) | |||
737 | { | 737 | { |
738 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 738 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
739 | int ch, txq_id, ret; | 739 | int ch, txq_id, ret; |
740 | unsigned long flags; | ||
741 | 740 | ||
742 | /* Turn off all Tx DMA fifos */ | 741 | /* Turn off all Tx DMA fifos */ |
743 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 742 | spin_lock(&trans_pcie->irq_lock); |
744 | 743 | ||
745 | iwl_pcie_txq_set_sched(trans, 0); | 744 | iwl_pcie_txq_set_sched(trans, 0); |
746 | 745 | ||
@@ -757,7 +756,7 @@ int iwl_pcie_tx_stop(struct iwl_trans *trans) | |||
757 | iwl_read_direct32(trans, | 756 | iwl_read_direct32(trans, |
758 | FH_TSSR_TX_STATUS_REG)); | 757 | FH_TSSR_TX_STATUS_REG)); |
759 | } | 758 | } |
760 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 759 | spin_unlock(&trans_pcie->irq_lock); |
761 | 760 | ||
762 | if (!trans_pcie->txq) { | 761 | if (!trans_pcie->txq) { |
763 | IWL_WARN(trans, | 762 | IWL_WARN(trans, |
@@ -865,7 +864,6 @@ int iwl_pcie_tx_init(struct iwl_trans *trans) | |||
865 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 864 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
866 | int ret; | 865 | int ret; |
867 | int txq_id, slots_num; | 866 | int txq_id, slots_num; |
868 | unsigned long flags; | ||
869 | bool alloc = false; | 867 | bool alloc = false; |
870 | 868 | ||
871 | if (!trans_pcie->txq) { | 869 | if (!trans_pcie->txq) { |
@@ -875,7 +873,7 @@ int iwl_pcie_tx_init(struct iwl_trans *trans) | |||
875 | alloc = true; | 873 | alloc = true; |
876 | } | 874 | } |
877 | 875 | ||
878 | spin_lock_irqsave(&trans_pcie->irq_lock, flags); | 876 | spin_lock(&trans_pcie->irq_lock); |
879 | 877 | ||
880 | /* Turn off all Tx DMA fifos */ | 878 | /* Turn off all Tx DMA fifos */ |
881 | iwl_write_prph(trans, SCD_TXFACT, 0); | 879 | iwl_write_prph(trans, SCD_TXFACT, 0); |
@@ -884,7 +882,7 @@ int iwl_pcie_tx_init(struct iwl_trans *trans) | |||
884 | iwl_write_direct32(trans, FH_KW_MEM_ADDR_REG, | 882 | iwl_write_direct32(trans, FH_KW_MEM_ADDR_REG, |
885 | trans_pcie->kw.dma >> 4); | 883 | trans_pcie->kw.dma >> 4); |
886 | 884 | ||
887 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 885 | spin_unlock(&trans_pcie->irq_lock); |
888 | 886 | ||
889 | /* Alloc and init all Tx queues, including the command queue (#4/#9) */ | 887 | /* Alloc and init all Tx queues, including the command queue (#4/#9) */ |
890 | for (txq_id = 0; txq_id < trans->cfg->base_params->num_of_queues; | 888 | for (txq_id = 0; txq_id < trans->cfg->base_params->num_of_queues; |