aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2013-12-11 02:24:39 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2013-12-21 14:21:25 -0500
commitfe523dc9e90569656b19229d08b27d6cd55f9700 (patch)
tree8f6c92c31688d98511d429bd1655bf8fd834a4f9 /drivers/net/wireless/iwlwifi
parent7117c000c8370026ee66e8c4b1e1e9838f9962fa (diff)
iwlwifi: pcie: no need to save inta in trans_pcie
This was useful when the handling was not in the same context as the interrupt cause retrieval: we could have several hard interrupts until the handler gets called. Since we retrieve the interrupt cause in the handler itself, there is no need to OR the interrupt causes. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/internal.h1
-rw-r--r--drivers/net/wireless/iwlwifi/pcie/rx.c22
2 files changed, 7 insertions, 16 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/internal.h b/drivers/net/wireless/iwlwifi/pcie/internal.h
index 6a32eccf71c9..9dfee7ed2e3e 100644
--- a/drivers/net/wireless/iwlwifi/pcie/internal.h
+++ b/drivers/net/wireless/iwlwifi/pcie/internal.h
@@ -273,7 +273,6 @@ struct iwl_trans_pcie {
273 __le32 *ict_tbl; 273 __le32 *ict_tbl;
274 dma_addr_t ict_tbl_dma; 274 dma_addr_t ict_tbl_dma;
275 int ict_index; 275 int ict_index;
276 u32 inta;
277 bool use_ict; 276 bool use_ict;
278 struct isr_statistics isr_stats; 277 struct isr_statistics isr_stats;
279 278
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c
index a042c4a80465..9e019e59f473 100644
--- a/drivers/net/wireless/iwlwifi/pcie/rx.c
+++ b/drivers/net/wireless/iwlwifi/pcie/rx.c
@@ -838,18 +838,16 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
838 * the handler can be scheduled because of a previous 838 * the handler can be scheduled because of a previous
839 * interrupt. 839 * interrupt.
840 */ 840 */
841 if (test_bit(STATUS_INT_ENABLED, &trans->status) && 841 if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
842 !trans_pcie->inta)
843 iwl_enable_interrupts(trans); 842 iwl_enable_interrupts(trans);
844 return trans_pcie->inta; 843 return inta;
845 } 844 }
846 845
847 if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { 846 if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) {
848 /* Hardware disappeared. It might have already raised 847 /* Hardware disappeared. It might have already raised
849 * an interrupt */ 848 * an interrupt */
850 IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta); 849 IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta);
851 trans_pcie->inta = 0xFFFFFFFF; 850 return 0xFFFFFFFF;
852 return trans_pcie->inta;
853 } 851 }
854 852
855 if (iwl_have_debug_level(IWL_DL_ISR)) 853 if (iwl_have_debug_level(IWL_DL_ISR))
@@ -858,9 +856,8 @@ static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans)
858 inta, trans_pcie->inta_mask, 856 inta, trans_pcie->inta_mask,
859 iwl_read32(trans, CSR_FH_INT_STATUS)); 857 iwl_read32(trans, CSR_FH_INT_STATUS));
860 858
861 trans_pcie->inta |= inta;
862 /* the thread will service interrupts and re-enable them */ 859 /* the thread will service interrupts and re-enable them */
863 return trans_pcie->inta; 860 return inta;
864} 861}
865 862
866/* a device (PCI-E) page is 4096 bytes long */ 863/* a device (PCI-E) page is 4096 bytes long */
@@ -934,21 +931,19 @@ static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans)
934 iwl_read32(trans, CSR_INT_MASK)); 931 iwl_read32(trans, CSR_INT_MASK));
935 932
936 inta &= trans_pcie->inta_mask; 933 inta &= trans_pcie->inta_mask;
937 trans_pcie->inta |= inta;
938 934
939 /* iwl_pcie_tasklet() will service interrupts and re-enable them */ 935 /* iwl_pcie_tasklet() will service interrupts and re-enable them */
940 if (likely(inta)) 936 if (likely(inta))
941 return trans_pcie->inta; 937 return inta;
942 938
943 none: 939 none:
944 /* re-enable interrupts here since we don't have anything to service. 940 /* re-enable interrupts here since we don't have anything to service.
945 * only Re-enable if disabled by irq. 941 * only Re-enable if disabled by irq.
946 */ 942 */
947 if (test_bit(STATUS_INT_ENABLED, &trans->status) && 943 if (test_bit(STATUS_INT_ENABLED, &trans->status) && !inta)
948 !trans_pcie->inta)
949 iwl_enable_interrupts(trans); 944 iwl_enable_interrupts(trans);
950 945
951 return trans_pcie->inta; 946 return inta;
952} 947}
953 948
954irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) 949irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
@@ -1001,9 +996,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id)
1001 IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", 996 IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n",
1002 inta, iwl_read32(trans, CSR_INT_MASK)); 997 inta, iwl_read32(trans, CSR_INT_MASK));
1003 998
1004 /* saved interrupt in inta variable now we can reset trans_pcie->inta */
1005 trans_pcie->inta = 0;
1006
1007 spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); 999 spin_unlock_irqrestore(&trans_pcie->irq_lock, flags);
1008 1000
1009 /* Now service all interrupt bits discovered above. */ 1001 /* Now service all interrupt bits discovered above. */