linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.9] ath9k_hw: revert chainmask to user configuration after calibration
@ 2013-03-15 13:53 Felix Fietkau
  2013-03-15 18:34 ` Luis R. Rodriguez
  0 siblings, 1 reply; 3+ messages in thread
From: Felix Fietkau @ 2013-03-15 13:53 UTC (permalink / raw)
  To: linux-wireless; +Cc: linville, Wojciech.Dubowik, mcgrof

The commit 'ath9k_hw: fix calibration issues on chainmask that don't
include chain 0' changed the hardware chainmask to the chip chainmask
for the duration of the calibration, but the revert to user
configuration in the reset path runs too early.

That causes some issues with limiting the number of antennas (including
spurious failure in hardware-generated packets).

Fix this by reverting the chainmask after the essential parts of the
calibration that need the workaround, and before NF calibration is run.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Tested-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Cc: stable@vger.kernel.org
---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 4cc1394..f76c3ca 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -1023,6 +1023,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
 					  AR_PHY_AGC_CONTROL_FLTR_CAL   |
 					  AR_PHY_AGC_CONTROL_PKDET_CAL;
 
+	/* Use chip chainmask only for calibration */
 	ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
 
 	if (rtt) {
@@ -1150,6 +1151,9 @@ skip_tx_iqcal:
 		ar9003_hw_rtt_disable(ah);
 	}
 
+	/* Revert chainmask to runtime parameters */
+	ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
+
 	/* Initialize list pointers */
 	ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
 
-- 
1.8.0.2


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

* Re: [PATCH 3.9] ath9k_hw: revert chainmask to user configuration after calibration
  2013-03-15 13:53 [PATCH 3.9] ath9k_hw: revert chainmask to user configuration after calibration Felix Fietkau
@ 2013-03-15 18:34 ` Luis R. Rodriguez
  2013-03-15 22:21   ` Felix Fietkau
  0 siblings, 1 reply; 3+ messages in thread
From: Luis R. Rodriguez @ 2013-03-15 18:34 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, linville, Wojciech.Dubowik, mcgrof

On Fri, Mar 15, 2013 at 02:53:31PM +0100, Felix Fietkau wrote:
> The commit 'ath9k_hw: fix calibration issues on chainmask that don't
> include chain 0' changed the hardware chainmask to the chip chainmask
> for the duration of the calibration, but the revert to user
> configuration in the reset path runs too early.
> 
> That causes some issues with limiting the number of antennas (including
> spurious failure in hardware-generated packets).
> 
> Fix this by reverting the chainmask after the essential parts of the
> calibration that need the workaround, and before NF calibration is run.
> 
> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
> Reported-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
> Tested-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
> Cc: stable@vger.kernel.org

This applies to v3.8 as well with the following changes, do you want
it there as well?

diff --git a/drivers/net/wireless/ath/ath9k/ar9003_calib.c b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
index 56317b0..e99f481 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
@@ -976,6 +976,7 @@ static bool ar9003_hw_init_cal(struct ath_hw *ah,
 					  AR_PHY_CL_TAB_1,
 					  AR_PHY_CL_TAB_2 };
 
+	/* Use chip chainmask only for calibration */
 	ar9003_hw_set_chain_masks(ah, ah->caps.rx_chainmask, ah->caps.tx_chainmask);
 
 	if (rtt) {
@@ -1131,6 +1132,9 @@ skip_tx_iqcal:
 		ar9003_hw_rtt_disable(ah);
 	}
 
+	/* Revert chainmask to runtime parameters */
+	ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
+
 	/* Initialize list pointers */
 	ah->cal_list = ah->cal_list_last = ah->cal_list_curr = NULL;
 	ah->supp_cals = IQ_MISMATCH_CAL;

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

* Re: [PATCH 3.9] ath9k_hw: revert chainmask to user configuration after calibration
  2013-03-15 18:34 ` Luis R. Rodriguez
@ 2013-03-15 22:21   ` Felix Fietkau
  0 siblings, 0 replies; 3+ messages in thread
From: Felix Fietkau @ 2013-03-15 22:21 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: linux-wireless, linville, Wojciech.Dubowik, mcgrof

On 2013-03-15 7:34 PM, Luis R. Rodriguez wrote:
> On Fri, Mar 15, 2013 at 02:53:31PM +0100, Felix Fietkau wrote:
>> The commit 'ath9k_hw: fix calibration issues on chainmask that don't
>> include chain 0' changed the hardware chainmask to the chip chainmask
>> for the duration of the calibration, but the revert to user
>> configuration in the reset path runs too early.
>> 
>> That causes some issues with limiting the number of antennas (including
>> spurious failure in hardware-generated packets).
>> 
>> Fix this by reverting the chainmask after the essential parts of the
>> calibration that need the workaround, and before NF calibration is run.
>> 
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> Reported-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
>> Tested-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
>> Cc: stable@vger.kernel.org
> 
> This applies to v3.8 as well with the following changes, do you want
> it there as well?
Yes


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

end of thread, other threads:[~2013-03-15 22:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-15 13:53 [PATCH 3.9] ath9k_hw: revert chainmask to user configuration after calibration Felix Fietkau
2013-03-15 18:34 ` Luis R. Rodriguez
2013-03-15 22:21   ` 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).