Bug 14566 - Ath5k: Decreasing Txpower with random intervals
Ath5k: Decreasing Txpower with random intervals
Product: Drivers
Classification: Unclassified
Component: network-wireless
All Linux
: P1 high
Assigned To: drivers_network-wireless@kernel-bugs.osdl.org
Depends on:
  Show dependency treegraph
Reported: 2009-11-09 11:29 UTC by Daniel Folkers
Modified: 2010-08-13 15:47 UTC (History)
5 users (show)

See Also:
Kernel Version: 2.6.31
Tree: Mainline
Regression: No

Channel power - left as expected, right 20dBm drop (292.35 KB, image/jpeg)
2009-11-09 11:29 UTC, Daniel Folkers

Description Daniel Folkers 2009-11-09 11:29:42 UTC
Created attachment 23710 [details]
Channel power - left as expected, right 20dBm drop

I did some testing with ath5k after the txpower of ath5k has become settable in the 2.6.31 kernel. I tested with a Rohde&Schwarz spectrum analyser, and did a channel power measurement. I used a R52H minipci card with Atheros AR5414 chipset in it, using the ath5k driver. The antenna output is connected with a coax cable to the spectrum analyser input (closed system). I used channel 11 (2462MHz) in Ad-Hoc mode. Txpower is set to 20dBm (100mW). 
A multicast with a duty cycle of 80% is used.

The results are interesting: with random intervals, the transmit power decreases with 20dBm! The figures talk for themselves.
Comment 1 Daniel Folkers 2009-11-09 11:31:22 UTC
Comment on attachment 23710 [details]
Channel power - left as expected, right 20dBm drop

There is nothing changed in the settings, the power drops randomly
Comment 2 Bob Copeland 2009-11-12 02:47:44 UTC
Very cool, I wish I had that equipment.  Can you correlate the drops with any visible behavior (e.g. happens every 10 seconds, or on the beacon interval, or during scans?)
Comment 3 Daniel Folkers 2009-11-13 08:30:04 UTC
For now I can't correlate it to visible behaviour. Sometimes it drops 3 times a minute for the duration of a couple of seconds. Other times I do not see this behaviour for minutes. 

The reason I blame the driver that I see this behaviour also when using other chipsets (ex. XR2). That is what makes the driver suspicious for me.
I plan to do some further examination, when you can help me with some tips&tricks about what to test to further examine this problem, I would very appreciate it.
Comment 4 Bob Copeland 2009-11-13 12:55:57 UTC
One thing that would be interesting is to enable ftrace on your system.  Then you can mount debugfs and "cat /debug/tracing/available_filter_functions | grep ath5k" (file names are from memory, see Documentation/tracing/ for more info).  Writing some judicious ath5k function names into the filter, and tailing the trace_pipe file should show you when those functions are being called.

Interesting functions would be, for example, ath5k_reset, ath5k_tasklet_calibrate, ath5k_hw_txpower.
Comment 5 John W. Linville 2010-03-03 16:59:38 UTC
Daniel, does this issue persist w/ 2.6.33?  If so, please respond to the information request in comment 4.
Comment 6 Lukáš Turek 2010-03-05 23:47:39 UTC
The drop might be explained by the hardware switching TX antenna. Unfortunately there's no API for setting TX antenna in Ath5k yet, but you could try to hardcode it - replace AR5K_ANTMODE_DEFAULT by AR5K_ANTMODE_FIXED_A or AR5K_ANTMODE_FIXED_B in the call to ath5k_hw_set_antenna_mode() in base.c. It could stop the power drops, or at least you can measure how much lower is the power with incorrect antenna and if is the same as the power when the drop happens.
Comment 7 Bruno Randolf 2010-03-08 03:20:29 UTC
please check the following patches for fixing TX antenna:

Comment 8 John W. Linville 2010-08-13 15:47:13 UTC
No answer from comment 5, closing...

Note You need to log in before you can comment on or make changes to this bug.