aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2011-04-21 09:03:27 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-25 14:50:16 -0400
commit788f6875fcf5d2bce221fbfd2318ac48df299031 (patch)
tree933972db0fd520038b5e49701d2f2571e138b3c4 /drivers/net/wireless/ath
parentca45de77ad706e86b135b8564e21aa2c8a63f09b (diff)
ath9k: Fix bug in configuring hw timer
Hw next tigger time is configured as current_tsf + (timer_period * 10) which is wrong, it should be current_tsf + timer_period. The wrong hw timer configuration would cause btcoex related issues. Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath9k/gpio.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c13
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/net/wireless/ath/ath9k/gpio.c b/drivers/net/wireless/ath/ath9k/gpio.c
index 44a0a886124d..cc5fad6a4019 100644
--- a/drivers/net/wireless/ath/ath9k/gpio.c
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
@@ -138,10 +138,10 @@ static void ath_detect_bt_priority(struct ath_softc *sc)
138 138
139static void ath9k_gen_timer_start(struct ath_hw *ah, 139static void ath9k_gen_timer_start(struct ath_hw *ah,
140 struct ath_gen_timer *timer, 140 struct ath_gen_timer *timer,
141 u32 timer_next, 141 u32 trig_timeout,
142 u32 timer_period) 142 u32 timer_period)
143{ 143{
144 ath9k_hw_gen_timer_start(ah, timer, timer_next, timer_period); 144 ath9k_hw_gen_timer_start(ah, timer, trig_timeout, timer_period);
145 145
146 if ((ah->imask & ATH9K_INT_GENTIMER) == 0) { 146 if ((ah->imask & ATH9K_INT_GENTIMER) == 0) {
147 ath9k_hw_disable_interrupts(ah); 147 ath9k_hw_disable_interrupts(ah);
@@ -195,7 +195,7 @@ static void ath_btcoex_period_timer(unsigned long data)
195 195
196 timer_period = is_btscan ? btcoex->btscan_no_stomp : 196 timer_period = is_btscan ? btcoex->btscan_no_stomp :
197 btcoex->btcoex_no_stomp; 197 btcoex->btcoex_no_stomp;
198 ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, 0, 198 ath9k_gen_timer_start(ah, btcoex->no_stomp_timer, timer_period,
199 timer_period * 10); 199 timer_period * 10);
200 btcoex->hw_timer_enabled = true; 200 btcoex->hw_timer_enabled = true;
201 } 201 }
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 0fcfa5901a03..577ca59b02bf 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -2430,11 +2430,11 @@ EXPORT_SYMBOL(ath_gen_timer_alloc);
2430 2430
2431void ath9k_hw_gen_timer_start(struct ath_hw *ah, 2431void ath9k_hw_gen_timer_start(struct ath_hw *ah,
2432 struct ath_gen_timer *timer, 2432 struct ath_gen_timer *timer,
2433 u32 timer_next, 2433 u32 trig_timeout,
2434 u32 timer_period) 2434 u32 timer_period)
2435{ 2435{
2436 struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers; 2436 struct ath_gen_timer_table *timer_table = &ah->hw_gen_timers;
2437 u32 tsf; 2437 u32 tsf, timer_next;
2438 2438
2439 BUG_ON(!timer_period); 2439 BUG_ON(!timer_period);
2440 2440
@@ -2442,18 +2442,13 @@ void ath9k_hw_gen_timer_start(struct ath_hw *ah,
2442 2442
2443 tsf = ath9k_hw_gettsf32(ah); 2443 tsf = ath9k_hw_gettsf32(ah);
2444 2444
2445 timer_next = tsf + trig_timeout;
2446
2445 ath_dbg(ath9k_hw_common(ah), ATH_DBG_HWTIMER, 2447 ath_dbg(ath9k_hw_common(ah), ATH_DBG_HWTIMER,
2446 "current tsf %x period %x timer_next %x\n", 2448 "current tsf %x period %x timer_next %x\n",
2447 tsf, timer_period, timer_next); 2449 tsf, timer_period, timer_next);
2448 2450
2449 /* 2451 /*
2450 * Pull timer_next forward if the current TSF already passed it
2451 * because of software latency
2452 */
2453 if (timer_next < tsf)
2454 timer_next = tsf + timer_period;
2455
2456 /*
2457 * Program generic timer registers 2452 * Program generic timer registers
2458 */ 2453 */
2459 REG_WRITE(ah, gen_tmr_configuration[timer->index].next_addr, 2454 REG_WRITE(ah, gen_tmr_configuration[timer->index].next_addr,