2011-09-06 14:48:19

by Rajkumar Manoharan

[permalink] [raw]
Subject: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

Do the magnitude/phase coeff correction only if the outlier
is detected.

Cc: [email protected]
Signed-off-by: Rajkumar Manoharan <[email protected]>
---
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index fa35a02..ee3a8a2 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -643,8 +643,9 @@ static void ar9003_hw_detect_outlier(int *mp_coeff, int nmeasurement,
outlier_idx = max_idx;
else
outlier_idx = min_idx;
+
+ mp_coeff[outlier_idx] = mp_avg;
}
- mp_coeff[outlier_idx] = mp_avg;
}

static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
--
1.7.6.1



2011-09-14 03:48:49

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
> On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> > Do the magnitude/phase coeff correction only if the outlier
> > is detected.
> >
> > Cc: [email protected]
> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > ---
> >
> > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
>
> What is the effect of the bug being fixed here? Is this fix intended for 3.1?
>
The first entry of phase/mag got changed to average if outlier is not detected.
This patch ensures to update appropriate index of magnitude/phase. This patch is
applicable from 3.0 onwards.

--
Rajkumar

2011-09-14 13:47:04

by Adrian Chadd

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

.. and I wonder if there are any similar issues with AR9001/AR9002 series NICs.

I see some reasonably funny behaviour with calibration (under freebsd,
the calibration code is the same as ath9k) where the CRC error rates
for the high MCS rates fluctuate quite a bit.
I haven't bothered chasing it down as I've been busy chasing down TX
interrupt issues.



Adrian

2011-09-13 17:45:27

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> Do the magnitude/phase coeff correction only if the outlier
> is detected.
>
> Cc: [email protected]
> Signed-off-by: Rajkumar Manoharan <[email protected]>
> ---
> drivers/net/wireless/ath/ath9k/ar9003_calib.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
> index fa35a02..ee3a8a2 100644
> --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
> +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
> @@ -643,8 +643,9 @@ static void ar9003_hw_detect_outlier(int *mp_coeff, int nmeasurement,
> outlier_idx = max_idx;
> else
> outlier_idx = min_idx;
> +
> + mp_coeff[outlier_idx] = mp_avg;
> }
> - mp_coeff[outlier_idx] = mp_avg;
> }
>
> static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,

What is the effect of the bug being fixed here? Is this fix intended for 3.1?

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-14 17:00:29

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Wed, Sep 14, 2011 at 10:24:27PM +0530, Rajkumar Manoharan wrote:
> On Wed, Sep 14, 2011 at 02:33:22PM +0530, Rajkumar Manoharan wrote:
> > On Wed, Sep 14, 2011 at 11:45:20AM +0300, Kalle Valo wrote:
> > > Rajkumar Manoharan <[email protected]> writes:
> > >
> > > > On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
> > > >> On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> > > >> > Do the magnitude/phase coeff correction only if the outlier
> > > >> > is detected.
> > > >> >
> > > >> > Cc: [email protected]
> > > >> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > > >> > ---
> > > >> >
> > > >> > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
> > > >>
> > > >> What is the effect of the bug being fixed here? Is this fix intended for 3.1?
> > > >
> > > > The first entry of phase/mag got changed to average if outlier is
> > > > not detected. This patch ensures to update appropriate index of
> > > > magnitude/phase. This patch is applicable from 3.0 onwards.
> > >
> > > Sorry, but this doesn't tell much. What's the user visible change
> > > with this patch? Better sensitivity, less transmission errors or what?
> > >
> > It has minor impact because of this bug, an undesirable Tx IQ correction value
> > will be assigned to Tx gain settings wheen outlier is not happened. The impacts
> > on overall system throughput should be very minor.
> >
> John,
>
> Not doing the calibrations in proper manner could impact performance in congested
> network. Maybe i should update the impact in the commit log. Wanna send me v2
> patch?

Please.

--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-14 09:02:46

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Wed, Sep 14, 2011 at 11:45:20AM +0300, Kalle Valo wrote:
> Rajkumar Manoharan <[email protected]> writes:
>
> > On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
> >> On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> >> > Do the magnitude/phase coeff correction only if the outlier
> >> > is detected.
> >> >
> >> > Cc: [email protected]
> >> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> >> > ---
> >> >
> >> > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
> >>
> >> What is the effect of the bug being fixed here? Is this fix intended for 3.1?
> >
> > The first entry of phase/mag got changed to average if outlier is
> > not detected. This patch ensures to update appropriate index of
> > magnitude/phase. This patch is applicable from 3.0 onwards.
>
> Sorry, but this doesn't tell much. What's the user visible change
> with this patch? Better sensitivity, less transmission errors or what?
>
It has minor impact because of this bug, an undesirable Tx IQ correction value
will be assigned to Tx gain settings wheen outlier is not happened. The impacts
on overall system throughput should be very minor.

--
Rajkumar

2011-09-14 13:30:27

by John W. Linville

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Wed, Sep 14, 2011 at 09:19:24AM +0530, Rajkumar Manoharan wrote:
> On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
> > On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> > > Do the magnitude/phase coeff correction only if the outlier
> > > is detected.
> > >
> > > Cc: [email protected]
> > > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > > ---
> > >
> > > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
> >
> > What is the effect of the bug being fixed here? Is this fix intended for 3.1?
> >
> The first entry of phase/mag got changed to average if outlier is not detected.
> This patch ensures to update appropriate index of magnitude/phase. This patch is
> applicable from 3.0 onwards.

OK, but what happens if this patch isn't applied? Is there a crash?
Does the moon explode? Does my beer leak through a crack in the side
of my mug?

John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.

2011-09-14 16:53:52

by Rajkumar Manoharan

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

On Wed, Sep 14, 2011 at 02:33:22PM +0530, Rajkumar Manoharan wrote:
> On Wed, Sep 14, 2011 at 11:45:20AM +0300, Kalle Valo wrote:
> > Rajkumar Manoharan <[email protected]> writes:
> >
> > > On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
> > >> On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
> > >> > Do the magnitude/phase coeff correction only if the outlier
> > >> > is detected.
> > >> >
> > >> > Cc: [email protected]
> > >> > Signed-off-by: Rajkumar Manoharan <[email protected]>
> > >> > ---
> > >> >
> > >> > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
> > >>
> > >> What is the effect of the bug being fixed here? Is this fix intended for 3.1?
> > >
> > > The first entry of phase/mag got changed to average if outlier is
> > > not detected. This patch ensures to update appropriate index of
> > > magnitude/phase. This patch is applicable from 3.0 onwards.
> >
> > Sorry, but this doesn't tell much. What's the user visible change
> > with this patch? Better sensitivity, less transmission errors or what?
> >
> It has minor impact because of this bug, an undesirable Tx IQ correction value
> will be assigned to Tx gain settings wheen outlier is not happened. The impacts
> on overall system throughput should be very minor.
>
John,

Not doing the calibrations in proper manner could impact performance in congested
network. Maybe i should update the impact in the commit log. Wanna send me v2
patch?

--
Rajkumar

2011-09-14 08:45:26

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath9k_hw: Fix magnitude/phase coeff correction

Rajkumar Manoharan <[email protected]> writes:

> On Tue, Sep 13, 2011 at 01:32:26PM -0400, John W. Linville wrote:
>> On Tue, Sep 06, 2011 at 08:18:50PM +0530, Rajkumar Manoharan wrote:
>> > Do the magnitude/phase coeff correction only if the outlier
>> > is detected.
>> >
>> > Cc: [email protected]
>> > Signed-off-by: Rajkumar Manoharan <[email protected]>
>> > ---
>> >
>> > static void ar9003_hw_tx_iqcal_load_avg_2_passes(struct ath_hw *ah,
>>
>> What is the effect of the bug being fixed here? Is this fix intended for 3.1?
>
> The first entry of phase/mag got changed to average if outlier is
> not detected. This patch ensures to update appropriate index of
> magnitude/phase. This patch is applicable from 3.0 onwards.

Sorry, but this doesn't tell much. What's the user visible change
with this patch? Better sensitivity, less transmission errors or what?

--
Kalle Valo