diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-11 02:20:34 -0500 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2013-12-21 14:21:21 -0500 |
commit | 7117c000c8370026ee66e8c4b1e1e9838f9962fa (patch) | |
tree | 18ce25dce59109bce51a55c5225136c71bc9e050 /drivers/net/wireless/iwlwifi | |
parent | 0fec954249b55318aced45a0e47e1dd023986e5f (diff) |
iwlwifi: pcie: return inta from iwl_pcie_int_cause_{non_}ict
These functions are meant to return an interrupt cause and
not an irqreturn_t.
We still return IRQ_HANDLED if we had an error and IRQ_NONE
if our device hasn't fired any interrupt.
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/rx.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 58d3f649905c..a042c4a80465 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -807,7 +807,7 @@ static void iwl_pcie_irq_handle_error(struct iwl_trans *trans) | |||
807 | wake_up(&trans_pcie->wait_command_queue); | 807 | wake_up(&trans_pcie->wait_command_queue); |
808 | } | 808 | } |
809 | 809 | ||
810 | static irqreturn_t iwl_pcie_int_cause_non_ict(struct iwl_trans *trans) | 810 | static u32 iwl_pcie_int_cause_non_ict(struct iwl_trans *trans) |
811 | { | 811 | { |
812 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 812 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
813 | u32 inta; | 813 | u32 inta; |
@@ -841,14 +841,15 @@ static irqreturn_t iwl_pcie_int_cause_non_ict(struct iwl_trans *trans) | |||
841 | if (test_bit(STATUS_INT_ENABLED, &trans->status) && | 841 | if (test_bit(STATUS_INT_ENABLED, &trans->status) && |
842 | !trans_pcie->inta) | 842 | !trans_pcie->inta) |
843 | iwl_enable_interrupts(trans); | 843 | iwl_enable_interrupts(trans); |
844 | return IRQ_NONE; | 844 | return trans_pcie->inta; |
845 | } | 845 | } |
846 | 846 | ||
847 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { | 847 | if ((inta == 0xFFFFFFFF) || ((inta & 0xFFFFFFF0) == 0xa5a5a5a0)) { |
848 | /* Hardware disappeared. It might have already raised | 848 | /* Hardware disappeared. It might have already raised |
849 | * an interrupt */ | 849 | * an interrupt */ |
850 | IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta); | 850 | IWL_WARN(trans, "HARDWARE GONE?? INTA == 0x%08x\n", inta); |
851 | return IRQ_HANDLED; | 851 | trans_pcie->inta = 0xFFFFFFFF; |
852 | return trans_pcie->inta; | ||
852 | } | 853 | } |
853 | 854 | ||
854 | if (iwl_have_debug_level(IWL_DL_ISR)) | 855 | if (iwl_have_debug_level(IWL_DL_ISR)) |
@@ -859,7 +860,7 @@ static irqreturn_t iwl_pcie_int_cause_non_ict(struct iwl_trans *trans) | |||
859 | 860 | ||
860 | trans_pcie->inta |= inta; | 861 | trans_pcie->inta |= inta; |
861 | /* the thread will service interrupts and re-enable them */ | 862 | /* the thread will service interrupts and re-enable them */ |
862 | return IRQ_WAKE_THREAD; | 863 | return trans_pcie->inta; |
863 | } | 864 | } |
864 | 865 | ||
865 | /* a device (PCI-E) page is 4096 bytes long */ | 866 | /* a device (PCI-E) page is 4096 bytes long */ |
@@ -875,10 +876,9 @@ static irqreturn_t iwl_pcie_int_cause_non_ict(struct iwl_trans *trans) | |||
875 | * the interrupt we need to service, driver will set the entries back to 0 and | 876 | * the interrupt we need to service, driver will set the entries back to 0 and |
876 | * set index. | 877 | * set index. |
877 | */ | 878 | */ |
878 | static irqreturn_t iwl_pcie_int_cause_ict(struct iwl_trans *trans) | 879 | static u32 iwl_pcie_int_cause_ict(struct iwl_trans *trans) |
879 | { | 880 | { |
880 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 881 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
881 | irqreturn_t ret; | ||
882 | u32 inta; | 882 | u32 inta; |
883 | u32 val = 0; | 883 | u32 val = 0; |
884 | u32 read; | 884 | u32 read; |
@@ -938,9 +938,7 @@ static irqreturn_t iwl_pcie_int_cause_ict(struct iwl_trans *trans) | |||
938 | 938 | ||
939 | /* iwl_pcie_tasklet() will service interrupts and re-enable them */ | 939 | /* iwl_pcie_tasklet() will service interrupts and re-enable them */ |
940 | if (likely(inta)) | 940 | if (likely(inta)) |
941 | return IRQ_WAKE_THREAD; | 941 | return trans_pcie->inta; |
942 | |||
943 | ret = IRQ_HANDLED; | ||
944 | 942 | ||
945 | none: | 943 | none: |
946 | /* re-enable interrupts here since we don't have anything to service. | 944 | /* re-enable interrupts here since we don't have anything to service. |
@@ -950,7 +948,7 @@ static irqreturn_t iwl_pcie_int_cause_ict(struct iwl_trans *trans) | |||
950 | !trans_pcie->inta) | 948 | !trans_pcie->inta) |
951 | iwl_enable_interrupts(trans); | 949 | iwl_enable_interrupts(trans); |
952 | 950 | ||
953 | return ret; | 951 | return trans_pcie->inta; |
954 | } | 952 | } |
955 | 953 | ||
956 | irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | 954 | irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) |
@@ -961,7 +959,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
961 | u32 inta = 0; | 959 | u32 inta = 0; |
962 | u32 handled = 0; | 960 | u32 handled = 0; |
963 | unsigned long flags; | 961 | unsigned long flags; |
964 | irqreturn_t ret; | ||
965 | u32 i; | 962 | u32 i; |
966 | 963 | ||
967 | lock_map_acquire(&trans->sync_cmd_lockdep_map); | 964 | lock_map_acquire(&trans->sync_cmd_lockdep_map); |
@@ -972,13 +969,19 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
972 | * use legacy interrupt. | 969 | * use legacy interrupt. |
973 | */ | 970 | */ |
974 | if (likely(trans_pcie->use_ict)) | 971 | if (likely(trans_pcie->use_ict)) |
975 | ret = iwl_pcie_int_cause_ict(trans); | 972 | inta = iwl_pcie_int_cause_ict(trans); |
976 | else | 973 | else |
977 | ret = iwl_pcie_int_cause_non_ict(trans); | 974 | inta = iwl_pcie_int_cause_non_ict(trans); |
978 | 975 | ||
979 | if (ret != IRQ_WAKE_THREAD) { | 976 | if (unlikely(!inta)) { |
980 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | 977 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); |
981 | return ret; | 978 | lock_map_release(&trans->sync_cmd_lockdep_map); |
979 | return IRQ_NONE; | ||
980 | } | ||
981 | |||
982 | if (unlikely(inta == 0xFFFFFFFF)) { | ||
983 | spin_unlock_irqrestore(&trans_pcie->irq_lock, flags); | ||
984 | goto out; | ||
982 | } | 985 | } |
983 | 986 | ||
984 | /* Ack/clear/reset pending uCode interrupts. | 987 | /* Ack/clear/reset pending uCode interrupts. |
@@ -992,10 +995,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
992 | * hardware bugs here by ACKing all the possible interrupts so that | 995 | * hardware bugs here by ACKing all the possible interrupts so that |
993 | * interrupt coalescing can still be achieved. | 996 | * interrupt coalescing can still be achieved. |
994 | */ | 997 | */ |
995 | iwl_write32(trans, CSR_INT, | 998 | iwl_write32(trans, CSR_INT, inta | ~trans_pcie->inta_mask); |
996 | trans_pcie->inta | ~trans_pcie->inta_mask); | ||
997 | |||
998 | inta = trans_pcie->inta; | ||
999 | 999 | ||
1000 | if (iwl_have_debug_level(IWL_DL_ISR)) | 1000 | if (iwl_have_debug_level(IWL_DL_ISR)) |
1001 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", | 1001 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", |