kernel/mac80211: backport bcma changes from 4.1
[openwrt.git] / package / kernel / mac80211 / patches / 309-ath9k-prevent-early-IRQs-from-accessing-hardware.patch
1 From: Felix Fietkau <nbd@openwrt.org>
2 Date: Thu, 13 Nov 2014 18:27:47 +0100
3 Subject: [PATCH] ath9k: prevent early IRQs from accessing hardware
4
5 IRQs are suppressed if ah == NULL and ATH_OP_INVALID being set in
6 common->op_flags. Close a short time window between those two.
7
8 Signed-off-by: Felix Fietkau <nbd@openwrt.org>
9 ---
10
11 --- a/drivers/net/wireless/ath/ath9k/init.c
12 +++ b/drivers/net/wireless/ath/ath9k/init.c
13 @@ -513,10 +513,14 @@ static int ath9k_init_softc(u16 devid, s
14         ah->reg_ops.read = ath9k_ioread32;
15         ah->reg_ops.write = ath9k_iowrite32;
16         ah->reg_ops.rmw = ath9k_reg_rmw;
17 -       sc->sc_ah = ah;
18         pCap = &ah->caps;
19  
20         common = ath9k_hw_common(ah);
21 +
22 +       /* Will be cleared in ath9k_start() */
23 +       set_bit(ATH_OP_INVALID, &common->op_flags);
24 +
25 +       sc->sc_ah = ah;
26         sc->dfs_detector = dfs_pattern_detector_init(common, NL80211_DFS_UNSET);
27         sc->tx99_power = MAX_RATE_POWER + 1;
28         init_waitqueue_head(&sc->tx_wait);
29 @@ -876,9 +880,6 @@ int ath9k_init_device(u16 devid, struct 
30         common = ath9k_hw_common(ah);
31         ath9k_set_hw_capab(sc, hw);
32  
33 -       /* Will be cleared in ath9k_start() */
34 -       set_bit(ATH_OP_INVALID, &common->op_flags);
35 -
36         /* Initialize regulatory */
37         error = ath_regd_init(&common->regulatory, sc->hw->wiphy,
38                               ath9k_reg_notifier);