aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/init.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-11-30 15:58:30 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-12-01 15:57:22 -0500
commit56bdbe0d6ac59c3eb17c2b9d715fb2e41467e354 (patch)
tree83ce959b8ba24889a56755624eae32c9febcf931 /drivers/net/wireless/ath/ath9k/init.c
parent9e4982f6a51a2442f1bb588fee42521b44b4531c (diff)
ath9k: prevent early IRQs from accessing hardware
IRQs are suppressed if ah == NULL and ATH_OP_INVALID being set in common->op_flags. Close a short time window between those two. 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/init.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 59d679cebc89..d1c39346b264 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -532,10 +532,14 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
532 ah->reg_ops.read = ath9k_ioread32; 532 ah->reg_ops.read = ath9k_ioread32;
533 ah->reg_ops.write = ath9k_iowrite32; 533 ah->reg_ops.write = ath9k_iowrite32;
534 ah->reg_ops.rmw = ath9k_reg_rmw; 534 ah->reg_ops.rmw = ath9k_reg_rmw;
535 sc->sc_ah = ah;
536 pCap = &ah->caps; 535 pCap = &ah->caps;
537 536
538 common = ath9k_hw_common(ah); 537 common = ath9k_hw_common(ah);
538
539 /* Will be cleared in ath9k_start() */
540 set_bit(ATH_OP_INVALID, &common->op_flags);
541
542 sc->sc_ah = ah;
539 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET); 543 sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
540 sc->tx99_power = MAX_RATE_POWER + 1; 544 sc->tx99_power = MAX_RATE_POWER + 1;
541 init_waitqueue_head(&sc->tx_wait); 545 init_waitqueue_head(&sc->tx_wait);
@@ -896,9 +900,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
896 common = ath9k_hw_common(ah); 900 common = ath9k_hw_common(ah);
897 ath9k_set_hw_capab(sc, hw); 901 ath9k_set_hw_capab(sc, hw);
898 902
899 /* Will be cleared in ath9k_start() */
900 set_bit(ATH_OP_INVALID, &common->op_flags);
901
902 /* Initialize regulatory */ 903 /* Initialize regulatory */
903 error = ath_regd_init(&common->regulatory, sc->hw->wiphy, 904 error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
904 ath9k_reg_notifier); 905 ath9k_reg_notifier);