diff options
author | Rajkumar Manoharan <rmanohar@qca.qualcomm.com> | 2011-09-06 11:30:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-14 13:56:33 -0400 |
commit | 6bc05a9555543d0f8cc56bf2647819aebe39e938 (patch) | |
tree | a8b183fb280c6a73ee0cf9dce0e1cee94c58c38c /drivers/net/wireless/ath/ath9k/debug.c | |
parent | f7e014dac29b1abe5c8fa8d721d43928633340ab (diff) |
ath9k: Move cycle conters under cc_lock
This patch protects cycle counters access by cc_lock
and also prints current sample index.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/debug.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index 556032762693..7f143872dc83 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c | |||
@@ -1323,16 +1323,17 @@ void ath9k_debug_samp_bb_mac(struct ath_softc *sc) | |||
1323 | 1323 | ||
1324 | ath9k_ps_wakeup(sc); | 1324 | ath9k_ps_wakeup(sc); |
1325 | 1325 | ||
1326 | spin_lock_bh(&sc->debug.samp_lock); | ||
1327 | |||
1326 | spin_lock_irqsave(&common->cc_lock, flags); | 1328 | spin_lock_irqsave(&common->cc_lock, flags); |
1327 | ath_hw_cycle_counters_update(common); | 1329 | ath_hw_cycle_counters_update(common); |
1328 | spin_unlock_irqrestore(&common->cc_lock, flags); | ||
1329 | |||
1330 | spin_lock_bh(&sc->debug.samp_lock); | ||
1331 | 1330 | ||
1332 | ATH_SAMP_DBG(cc.cycles) = common->cc_ani.cycles; | 1331 | ATH_SAMP_DBG(cc.cycles) = common->cc_ani.cycles; |
1333 | ATH_SAMP_DBG(cc.rx_busy) = common->cc_ani.rx_busy; | 1332 | ATH_SAMP_DBG(cc.rx_busy) = common->cc_ani.rx_busy; |
1334 | ATH_SAMP_DBG(cc.rx_frame) = common->cc_ani.rx_frame; | 1333 | ATH_SAMP_DBG(cc.rx_frame) = common->cc_ani.rx_frame; |
1335 | ATH_SAMP_DBG(cc.tx_frame) = common->cc_ani.tx_frame; | 1334 | ATH_SAMP_DBG(cc.tx_frame) = common->cc_ani.tx_frame; |
1335 | spin_unlock_irqrestore(&common->cc_lock, flags); | ||
1336 | |||
1336 | ATH_SAMP_DBG(noise) = ah->noise; | 1337 | ATH_SAMP_DBG(noise) = ah->noise; |
1337 | 1338 | ||
1338 | REG_WRITE_D(ah, AR_MACMISC, | 1339 | REG_WRITE_D(ah, AR_MACMISC, |
@@ -1390,6 +1391,8 @@ static int open_file_bb_mac_samps(struct inode *inode, struct file *file) | |||
1390 | spin_lock_bh(&sc->debug.samp_lock); | 1391 | spin_lock_bh(&sc->debug.samp_lock); |
1391 | memcpy(bb_mac_samp, sc->debug.bb_mac_samp, | 1392 | memcpy(bb_mac_samp, sc->debug.bb_mac_samp, |
1392 | sizeof(*bb_mac_samp) * ATH_DBG_MAX_SAMPLES); | 1393 | sizeof(*bb_mac_samp) * ATH_DBG_MAX_SAMPLES); |
1394 | len += snprintf(buf + len, size - len, | ||
1395 | "Current Sample Index: %d\n", sc->debug.sampidx); | ||
1393 | spin_unlock_bh(&sc->debug.samp_lock); | 1396 | spin_unlock_bh(&sc->debug.samp_lock); |
1394 | 1397 | ||
1395 | len += snprintf(buf + len, size - len, | 1398 | len += snprintf(buf + len, size - len, |