2011-05-26 05:00:36

by Adrian Chadd

[permalink] [raw]
Subject: [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

Hi,

The AR9287 initial calibration in ar9002_hw_init_cal() isn't ever
called because the Kite check (AR_SREV_9285_12_OR_LATER()) matches on
MACs versioned Kite and later.

The Atheros newma code checks it is Kite as well as being Kite >= 1.2.

I don't currently have Linux ath9k on something with an AR9287 so I'd
appreciate it if this were verified by someone who has.

The patch is quite simple:

diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
index 015d974..2d4c091 100644
--- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
@@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah,
struct ath9k_channel *chan)
if (AR_SREV_9271(ah)) {
if (!ar9285_hw_cl_cal(ah, chan))
return false;
- } else if (AR_SREV_9285_12_OR_LATER(ah)) {
+ } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
if (!ar9285_hw_clc(ah, chan))
return false;
} else {

Thanks,


Adrian


2011-05-26 15:04:19

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On Thu, May 26, 2011 at 8:26 PM, Adrian Chadd <[email protected]> wrote:
> On 26 May 2011 22:48, Mohammed Shafi <[email protected]> wrote:
>
>>> I hazard a guess that the rx calibration will affect RX sensitivity,
>>> maybe CRC errors? Or maximum link distance?
>>
>> Hmmm ok, if you got a chip please test it. I will be very happy if
>> this patch improves some performance or ?reduces some CRC errors :) I
>> will also look into this
>
> Well I've just brought up AR9287 support on FreeBSD with this RX
> calibration change and initial tests are promising.
>
> I unfortunately don't have anything yet w/ mini-PCIe that dual-boots
> Linux so I can't easily test ath9k out.
>
> Hence why I was asking for someone to please investigate for me :)

no problem, sure

>
> Thanks,
>
> Adrian
>

2011-05-26 12:26:25

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On Thu, May 26, 2011 at 10:30 AM, Adrian Chadd <[email protected]> wrote:
> Hi,
>
> The AR9287 initial calibration in ar9002_hw_init_cal() isn't ever
> called because the Kite check (AR_SREV_9285_12_OR_LATER()) matches on
> MACs versioned Kite and later.

yes, instead the calibration initialization for AR9285_12_OR_LATER is called.

>
> The Atheros newma code checks it is Kite as well as being Kite >= 1.2.

yes thats true.

>
> I don't currently have Linux ath9k on something with an AR9287 so I'd
> appreciate it if this were verified by someone who has.


did a quick preliminary tx throughput test not much difference.

>
> The patch is quite simple:
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> index 015d974..2d4c091 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> @@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah,
> struct ath9k_channel *chan)
> ? ? ? ?if (AR_SREV_9271(ah)) {
> ? ? ? ? ? ? ? ?if (!ar9285_hw_cl_cal(ah, chan))
> ? ? ? ? ? ? ? ? ? ? ? ?return false;
> - ? ? ? } else if (AR_SREV_9285_12_OR_LATER(ah)) {
> + ? ? ? } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
> ? ? ? ? ? ? ? ?if (!ar9285_hw_clc(ah, chan))
> ? ? ? ? ? ? ? ? ? ? ? ?return false;
> ? ? ? ?} else {
>
> Thanks,
>
>
> Adrian
> _______________________________________________
> ath9k-devel mailing list
> [email protected]
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>

2011-05-26 14:56:04

by Adrian Chadd

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On 26 May 2011 22:48, Mohammed Shafi <[email protected]> wrote:

>> I hazard a guess that the rx calibration will affect RX sensitivity,
>> maybe CRC errors? Or maximum link distance?
>
> Hmmm ok, if you got a chip please test it. I will be very happy if
> this patch improves some performance or ?reduces some CRC errors :) I
> will also look into this

Well I've just brought up AR9287 support on FreeBSD with this RX
calibration change and initial tests are promising.

I unfortunately don't have anything yet w/ mini-PCIe that dual-boots
Linux so I can't easily test ath9k out.

Hence why I was asking for someone to please investigate for me :)

Thanks,

Adrian

2011-05-26 14:48:31

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On Thu, May 26, 2011 at 7:41 PM, Adrian Chadd <[email protected]> wrote:
> On 26 May 2011 21:15, Mohammed Shafi <[email protected]> wrote:
>
>>> What about RX sensitivity/errors?
>>
>> should I look recv debug stats?
>
> I'm not a chip developer, so I don't really know. :)
>
> I hazard a guess that the rx calibration will affect RX sensitivity,
> maybe CRC errors? Or maximum link distance?

Hmmm ok, if you got a chip please test it. I will be very happy if
this patch improves some performance or reduces some CRC errors :) I
will also look into this

>
>
> Adrian
>

2011-05-26 13:15:21

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On Thu, May 26, 2011 at 6:29 PM, Adrian Chadd <[email protected]> wrote:
> On 26 May 2011 20:26, Mohammed Shafi <[email protected]> wrote:
>
>>
>> did a quick preliminary tx throughput test not much difference.
>
> What about RX sensitivity/errors?

should I look recv debug stats?

>
>
>
> Adrian
>

2011-05-26 12:59:51

by Adrian Chadd

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On 26 May 2011 20:26, Mohammed Shafi <[email protected]> wrote:

>
> did a quick preliminary tx throughput test not much difference.

What about RX sensitivity/errors?



Adrian

2011-05-26 12:15:41

by Mohammed Shafi

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On Thu, May 26, 2011 at 10:30 AM, Adrian Chadd <[email protected]> wrote:
> Hi,
>
> The AR9287 initial calibration in ar9002_hw_init_cal() isn't ever
> called because the Kite check (AR_SREV_9285_12_OR_LATER()) matches on
> MACs versioned Kite and later.

Adrian this change looks logically correct. but as there were lot of
regwrites in the original path, I am not sure how this change will
effect the throughput especially in noisy environment
conditions/stress testing.

>
> The Atheros newma code checks it is Kite as well as being Kite >= 1.2.
>
> I don't currently have Linux ath9k on something with an AR9287 so I'd
> appreciate it if this were verified by someone who has.
>
> The patch is quite simple:
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> index 015d974..2d4c091 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
> @@ -829,7 +829,7 @@ static bool ar9002_hw_init_cal(struct ath_hw *ah,
> struct ath9k_channel *chan)
> ? ? ? ?if (AR_SREV_9271(ah)) {
> ? ? ? ? ? ? ? ?if (!ar9285_hw_cl_cal(ah, chan))
> ? ? ? ? ? ? ? ? ? ? ? ?return false;
> - ? ? ? } else if (AR_SREV_9285_12_OR_LATER(ah)) {
> + ? ? ? } else if (AR_SREV_9285(ah) && AR_SREV_9285_12_OR_LATER(ah)) {
> ? ? ? ? ? ? ? ?if (!ar9285_hw_clc(ah, chan))
> ? ? ? ? ? ? ? ? ? ? ? ?return false;
> ? ? ? ?} else {
>
> Thanks,
>
>
> Adrian
> _______________________________________________
> ath9k-devel mailing list
> [email protected]
> https://lists.ath9k.org/mailman/listinfo/ath9k-devel
>

2011-05-26 14:11:31

by Adrian Chadd

[permalink] [raw]
Subject: Re: [ath9k-devel] [PATCH] ath9k: Fix Kiwi (AR9287) initial calibration

On 26 May 2011 21:15, Mohammed Shafi <[email protected]> wrote:

>> What about RX sensitivity/errors?
>
> should I look recv debug stats?

I'm not a chip developer, so I don't really know. :)

I hazard a guess that the rx calibration will affect RX sensitivity,
maybe CRC errors? Or maximum link distance?


Adrian