Re: [ath5k-devel] [PATCH] ath5k: Fix 64 bits TSF reading.

2010-03-08 Thread Benoit PAPILLAULT
Johannes Berg a écrit : > On Sun, 2010-02-28 at 23:08 +0100, Benoit Papillault wrote: > > >> -u64 tsf = ath5k_hw_reg_read(ah, AR5K_TSF_U32); >> +u32 tsf_lower, tsf_upper; >> + >> +/* >> + * While reading TSF upper and then lower part, the clock is still >> + * counting so the

Re: [ath5k-devel] [PATCH] ath5k: Fix 64 bits TSF reading.

2010-03-08 Thread Johannes Berg
On Sun, 2010-02-28 at 23:08 +0100, Benoit Papillault wrote: > - u64 tsf = ath5k_hw_reg_read(ah, AR5K_TSF_U32); > + u32 tsf_lower, tsf_upper; > + > + /* > + * While reading TSF upper and then lower part, the clock is still > + * counting so the lower part can rollover just aft

Re: [ath5k-devel] [PATCH] ath5k: Fix 64 bits TSF reading.

2010-02-28 Thread Benoit PAPILLAULT
Derek Smithies a écrit : > > Hi, > No, canot support this. > > What happens if there is an interrupt immediately after the first two > reads - before the test on tsf_lower? - and thisinterrupt lasts longer > than 100us ? Most often, this is ok - until the interrupt happens at > the wrong time.

Re: [ath5k-devel] [PATCH] ath5k: Fix 64 bits TSF reading.

2010-02-28 Thread Derek Smithies
Hi, No, canot support this. What happens if there is an interrupt immediately after the first two reads - before the test on tsf_lower? - and thisinterrupt lasts longer than 100us ? Most often, this is ok - until the interrupt happens at the wrong time. OR, there is a TSF merge event after

[ath5k-devel] [PATCH] ath5k: Fix 64 bits TSF reading.

2010-02-28 Thread Benoit Papillault
According to tests, both TSF lower and upper registers kept counting, so a rollover of the lower part can happen after the upper part has been read, as shown in the following log where the upper part is read first and the lower part next. tsf = {0003-fffd} tsf = {0003-0001} tsf = {