Skip to contentSkip to conversation

ath9k_hw: revert chainmask to user configuration after calibration

PATCH In review Felix Fietkau 2 participants 3 messages Mar 15, 2013 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath9k_hw: revert chainmask to user configuration after calibration

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.

---
 drivers/net/wireless/ath/ath9k/ar9003_calib.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/wireless/ath/ath9k/ar9003_calib.c +4 -0
index 4cc1394..f76c3ca 100644
@@ -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;
 
Signature · 1 line
1.8.0.2
#1 lore raw
Quoted 8 lines · Felix Fietkau

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).

Quoted 7 lines

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

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

drivers/net/wireless/ath/ath9k/ar9003_calib.c +4 -0
index 56317b0..e99f481 100644
@@ -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;
#2 lore raw
Quoted 12 lines · Luis R. Rodriguez
Quoted 11 lines · Felix Fietkau

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.

Quoted 7 lines
Quoted 4 lines

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

Yes