linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ath9k: ap tsf seems random and only uses lower 24 bits or so
@ 2010-06-28 22:31 Björn Smedman
  2010-06-28 22:55 ` Felix Fietkau
  0 siblings, 1 reply; 14+ messages in thread
From: Björn Smedman @ 2010-06-28 22:31 UTC (permalink / raw)
  To: linux-wireless, ath9k-devel

Hi all,

I'm getting weird values from the debugfs file ieee80211/phy0/tsf: the
value goes up and down rather randomly and only the lower 24 bits or
so seem to ever be used (see below for details).

The only thing running on phy0 is a single ap interface (and the
monitor companion that hostapd sets up). I was expecting tsf to
increase monotonically until all 64 bits had been used.

root@OpenWrt:/debug/ieee80211/phy0# dmesg | grep phy0
phy0: Selected rate control algorithm 'minstrel_ht'
phy0: Atheros AR9100 MAC/BB Rev:0 AR2133 RF Rev:a2 mem=0xb80c0000, irq=2
root@OpenWrt:/debug/ieee80211/phy0# while sleep 1; do cat tsf; done
0x0000000000059d9b
0x0000000000038fa2
0x00000000000ee67e
0x000000000008121e
0x000000000017752d
0x000000000006438b
0x000000000015a771
0x00000000000d5ea0
0x0000000000085b43
0x0000000000037806
0x000000000001f562
0x0000000000115b03
0x000000000020be55
^C

If you poll tsf really fast it looks a bit like it's running correctly
but being reset very often:

root@OpenWrt:/debug/ieee80211/phy0# while true; do cat tsf; done
...
0x00000000004b2319
0x00000000004b33f2
0x00000000004b46dc
0x00000000004b578c
0x00000000004b6a89
0x0000000000014435
0x00000000000154a0
0x00000000000167ce
0x000000000001785d
...
^C

For a moment I thought it might be the kernel snprintf (on mips)
playing a trick on me so I tried the following patch. But the result
is the same.

diff -urN a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -63,7 +63,8 @@

 	tsf = drv_get_tsf(local);

-	snprintf(buf, sizeof(buf), "0x%016llx\n", (unsigned long long) tsf);
+	snprintf(buf, sizeof(buf), "0x%08lx%08lx\n",
+		 (unsigned long)(tsf >> 32), (unsigned long)tsf);

 	return simple_read_from_buffer(user_buf, count, ppos, buf, 19);
 }


What could be causing this? Because it's not supposed to do this,
right? Any insight much appreciated!

/Björn

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-06-29 23:56 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-28 22:31 ath9k: ap tsf seems random and only uses lower 24 bits or so Björn Smedman
2010-06-28 22:55 ` Felix Fietkau
2010-06-29  6:08   ` [ath9k-devel] " Benoit Papillault
2010-06-29 11:45     ` Felix Fietkau
2010-06-29 21:23       ` Benoit Papillault
2010-06-29 15:20   ` Björn Smedman
2010-06-29 15:55     ` Felix Fietkau
2010-06-29 16:36       ` Björn Smedman
2010-06-29 16:52         ` Felix Fietkau
2010-06-29 17:32           ` Björn Smedman
2010-06-29 21:40             ` Björn Smedman
2010-06-29 21:54               ` Felix Fietkau
2010-06-29 22:50                 ` Björn Smedman
2010-06-29 23:56                   ` Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).