diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-11-08 14:54:47 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-09 16:13:24 -0500 |
commit | 4df3071ebd92ef7115b409da64d0eb405d24a631 (patch) | |
tree | 825eaecb9d9e8d0fde7f61e5f98fdd823ccef718 /drivers/net/wireless/ath/ath9k/main.c | |
parent | 790a11f268373b60069bc1371dc05143107c607c (diff) |
ath9k_hw: optimize interrupt mask changes
OProfile showed that ath9k was spending way too much time in
ath9k_hw_set_interrupts. Since most of the interrupt mask changes only
need to globally enable/disable interrupts, it makes sense to split
this part into separate functions, replacing all calls to
ath9k_hw_set_interrupts(ah, 0) with ath9k_hw_disable_interrupts(ah).
ath9k_hw_set_interrupts(ah, ah->imask) only gets changed to
ath9k_hw_enable_interrupts(ah), whenever ah->imask was not changed
since the point where interrupts were disabled.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index b52f1cf8a60..ade9d7c1603 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -239,7 +239,7 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | |||
239 | * hardware at the new frequency, and then re-enable | 239 | * hardware at the new frequency, and then re-enable |
240 | * the relevant bits of the h/w. | 240 | * the relevant bits of the h/w. |
241 | */ | 241 | */ |
242 | ath9k_hw_set_interrupts(ah, 0); | 242 | ath9k_hw_disable_interrupts(ah); |
243 | ath_drain_all_txq(sc, false); | 243 | ath_drain_all_txq(sc, false); |
244 | 244 | ||
245 | spin_lock_bh(&sc->rx.pcu_lock); | 245 | spin_lock_bh(&sc->rx.pcu_lock); |
@@ -653,7 +653,7 @@ void ath9k_tasklet(unsigned long data) | |||
653 | ath_gen_timer_isr(sc->sc_ah); | 653 | ath_gen_timer_isr(sc->sc_ah); |
654 | 654 | ||
655 | /* re-enable hardware interrupt */ | 655 | /* re-enable hardware interrupt */ |
656 | ath9k_hw_set_interrupts(ah, ah->imask); | 656 | ath9k_hw_enable_interrupts(ah); |
657 | ath9k_ps_restore(sc); | 657 | ath9k_ps_restore(sc); |
658 | } | 658 | } |
659 | 659 | ||
@@ -752,7 +752,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
752 | * interrupt; otherwise it will continue to | 752 | * interrupt; otherwise it will continue to |
753 | * fire. | 753 | * fire. |
754 | */ | 754 | */ |
755 | ath9k_hw_set_interrupts(ah, 0); | 755 | ath9k_hw_disable_interrupts(ah); |
756 | /* | 756 | /* |
757 | * Let the hal handle the event. We assume | 757 | * Let the hal handle the event. We assume |
758 | * it will clear whatever condition caused | 758 | * it will clear whatever condition caused |
@@ -761,7 +761,7 @@ irqreturn_t ath_isr(int irq, void *dev) | |||
761 | spin_lock(&common->cc_lock); | 761 | spin_lock(&common->cc_lock); |
762 | ath9k_hw_proc_mib_event(ah); | 762 | ath9k_hw_proc_mib_event(ah); |
763 | spin_unlock(&common->cc_lock); | 763 | spin_unlock(&common->cc_lock); |
764 | ath9k_hw_set_interrupts(ah, ah->imask); | 764 | ath9k_hw_enable_interrupts(ah); |
765 | } | 765 | } |
766 | 766 | ||
767 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) | 767 | if (!(ah->caps.hw_caps & ATH9K_HW_CAP_AUTOSLEEP)) |
@@ -778,8 +778,8 @@ chip_reset: | |||
778 | ath_debug_stat_interrupt(sc, status); | 778 | ath_debug_stat_interrupt(sc, status); |
779 | 779 | ||
780 | if (sched) { | 780 | if (sched) { |
781 | /* turn off every interrupt except SWBA */ | 781 | /* turn off every interrupt */ |
782 | ath9k_hw_set_interrupts(ah, (ah->imask & ATH9K_INT_SWBA)); | 782 | ath9k_hw_disable_interrupts(ah); |
783 | tasklet_schedule(&sc->intr_tq); | 783 | tasklet_schedule(&sc->intr_tq); |
784 | } | 784 | } |
785 | 785 | ||
@@ -937,7 +937,7 @@ void ath_radio_disable(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
937 | } | 937 | } |
938 | 938 | ||
939 | /* Disable interrupts */ | 939 | /* Disable interrupts */ |
940 | ath9k_hw_set_interrupts(ah, 0); | 940 | ath9k_hw_disable_interrupts(ah); |
941 | 941 | ||
942 | ath_drain_all_txq(sc, false); /* clear pending tx frames */ | 942 | ath_drain_all_txq(sc, false); /* clear pending tx frames */ |
943 | 943 | ||
@@ -980,7 +980,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx) | |||
980 | 980 | ||
981 | ieee80211_stop_queues(hw); | 981 | ieee80211_stop_queues(hw); |
982 | 982 | ||
983 | ath9k_hw_set_interrupts(ah, 0); | 983 | ath9k_hw_disable_interrupts(ah); |
984 | ath_drain_all_txq(sc, retry_tx); | 984 | ath_drain_all_txq(sc, retry_tx); |
985 | 985 | ||
986 | spin_lock_bh(&sc->rx.pcu_lock); | 986 | spin_lock_bh(&sc->rx.pcu_lock); |
@@ -1394,7 +1394,7 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1394 | 1394 | ||
1395 | /* make sure h/w will not generate any interrupt | 1395 | /* make sure h/w will not generate any interrupt |
1396 | * before setting the invalid flag. */ | 1396 | * before setting the invalid flag. */ |
1397 | ath9k_hw_set_interrupts(ah, 0); | 1397 | ath9k_hw_disable_interrupts(ah); |
1398 | 1398 | ||
1399 | spin_lock_bh(&sc->rx.pcu_lock); | 1399 | spin_lock_bh(&sc->rx.pcu_lock); |
1400 | if (!(sc->sc_flags & SC_OP_INVALID)) { | 1400 | if (!(sc->sc_flags & SC_OP_INVALID)) { |