aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2012-06-12 00:43:53 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-13 14:35:56 -0400
commit3c7992e33ab8d0c625a45ded11cc10d5b622bcd4 (patch)
tree3f09d4b57c3df556a5281704ffb86e199685df2f
parentdfd0587a7d99d42cc2d608324991169494d2dbba (diff)
ath9k: defer btcoex scheme update
As btcoex scheme updation might sleep, remove the function call from tasklet context and queue it up as a separate work. Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c3
-rw-r--r--drivers/net/wireless/ath/ath9k/mci.c14
3 files changed, 15 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 02fc1c1e5eeb..a8c050085648 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -698,6 +698,7 @@ struct ath_softc {
698#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT 698#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
699 struct ath_btcoex btcoex; 699 struct ath_btcoex btcoex;
700 struct ath_mci_coex mci_coex; 700 struct ath_mci_coex mci_coex;
701 struct work_struct mci_work;
701#endif 702#endif
702 703
703 struct ath_descdma txsdma; 704 struct ath_descdma txsdma;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index e655f2a907b5..a6f83b683db1 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -150,6 +150,9 @@ static void __ath_cancel_work(struct ath_softc *sc)
150 cancel_work_sync(&sc->hw_check_work); 150 cancel_work_sync(&sc->hw_check_work);
151 cancel_delayed_work_sync(&sc->tx_complete_work); 151 cancel_delayed_work_sync(&sc->tx_complete_work);
152 cancel_delayed_work_sync(&sc->hw_pll_work); 152 cancel_delayed_work_sync(&sc->hw_pll_work);
153#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
154 cancel_work_sync(&sc->mci_work);
155#endif
153} 156}
154 157
155static void ath_cancel_work(struct ath_softc *sc) 158static void ath_cancel_work(struct ath_softc *sc)
diff --git a/drivers/net/wireless/ath/ath9k/mci.c b/drivers/net/wireless/ath/ath9k/mci.c
index 92d61cc0c8e5..e53df86dfce5 100644
--- a/drivers/net/wireless/ath/ath9k/mci.c
+++ b/drivers/net/wireless/ath/ath9k/mci.c
@@ -52,7 +52,7 @@ static bool ath_mci_add_profile(struct ath_common *common,
52 (info->type != MCI_GPM_COEX_PROFILE_VOICE)) 52 (info->type != MCI_GPM_COEX_PROFILE_VOICE))
53 return false; 53 return false;
54 54
55 entry = kzalloc(sizeof(*entry), GFP_KERNEL); 55 entry = kzalloc(sizeof(*entry), GFP_ATOMIC);
56 if (!entry) 56 if (!entry)
57 return false; 57 return false;
58 58
@@ -219,6 +219,13 @@ static void ath_mci_cal_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
219 } 219 }
220} 220}
221 221
222static void ath9k_mci_work(struct work_struct *work)
223{
224 struct ath_softc *sc = container_of(work, struct ath_softc, mci_work);
225
226 ath_mci_update_scheme(sc);
227}
228
222static void ath_mci_process_profile(struct ath_softc *sc, 229static void ath_mci_process_profile(struct ath_softc *sc,
223 struct ath_mci_profile_info *info) 230 struct ath_mci_profile_info *info)
224{ 231{
@@ -249,7 +256,7 @@ static void ath_mci_process_profile(struct ath_softc *sc,
249 btcoex->duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE; 256 btcoex->duty_cycle = ATH_BTCOEX_DEF_DUTY_CYCLE;
250 } 257 }
251 258
252 ath_mci_update_scheme(sc); 259 ieee80211_queue_work(sc->hw, &sc->mci_work);
253} 260}
254 261
255static void ath_mci_process_status(struct ath_softc *sc, 262static void ath_mci_process_status(struct ath_softc *sc,
@@ -283,7 +290,7 @@ static void ath_mci_process_status(struct ath_softc *sc,
283 } while (++i < ATH_MCI_MAX_PROFILE); 290 } while (++i < ATH_MCI_MAX_PROFILE);
284 291
285 if (old_num_mgmt != mci->num_mgmt) 292 if (old_num_mgmt != mci->num_mgmt)
286 ath_mci_update_scheme(sc); 293 ieee80211_queue_work(sc->hw, &sc->mci_work);
287} 294}
288 295
289static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload) 296static void ath_mci_msg(struct ath_softc *sc, u8 opcode, u8 *rx_payload)
@@ -377,6 +384,7 @@ int ath_mci_setup(struct ath_softc *sc)
377 mci->gpm_buf.bf_addr, (mci->gpm_buf.bf_len >> 4), 384 mci->gpm_buf.bf_addr, (mci->gpm_buf.bf_len >> 4),
378 mci->sched_buf.bf_paddr); 385 mci->sched_buf.bf_paddr);
379 386
387 INIT_WORK(&sc->mci_work, ath9k_mci_work);
380 ath_dbg(common, MCI, "MCI Initialized\n"); 388 ath_dbg(common, MCI, "MCI Initialized\n");
381 389
382 return 0; 390 return 0;