ath5k: do not stop queues for full calibration
PATCH 1/2 ath5k: do not stop queues for full calibration
Some calibration types interfere with tx activity, but the queue stop does not prevent that. In fact, some calibration types need tx activity to properly function, so stopping the queues for them is counterproductive. In some tests this patch has been shown to improve stability, especially in AP or ad-hoc mode.
--- drivers/net/wireless/ath/ath5k/base.c | 14 ++------------ 1 files changed, 2 insertions(+), 12 deletions(-)
drivers/net/wireless/ath/ath5k/base.c +2 -12
@@ -2330,15 +2330,6 @@ ath5k_calibrate_work(struct work_struct *work) "got new rfgain, resetting\n");ieee80211_queue_work (ah->hw, &ah->reset_work); } - -/* TODO: On full calibration we should stop TX here, -* so that it doesn't interfere (mostly due to gain_f -* calibration that messes with tx packets -see phy.c). -* -* NOTE: Stopping the queues from above is not enough -* to stop TX but saves us from disconecting (at least -* we don't lose packets). */ -ieee80211_stop_queues (ah->hw); }else ah->ah_cal_mask |=AR5K_CALIBRATION_SHORT ;
@@ -2353,10 +2344,9 @@ ath5k_calibrate_work(struct work_struct *work) ah->curchan->center_freq));/* Clear calibration flags */ -if (ah->ah_cal_mask &AR5K_CALIBRATION_FULL ) { -ieee80211_wake_queues (ah->hw); +if (ah->ah_cal_mask &AR5K_CALIBRATION_FULL ) ah->ah_cal_mask &= ~AR5K_CALIBRATION_FULL ; - }else if (ah->ah_cal_mask &AR5K_CALIBRATION_SHORT ) +else if (ah->ah_cal_mask &AR5K_CALIBRATION_SHORT ) ah->ah_cal_mask &= ~AR5K_CALIBRATION_SHORT ; }
Signature · 1 line
1.7.3.2
PATCH 2/2 ath5k: do not re-run AGC calibration periodically
All other Atheros drivers run the AGC gain calibration and DC offset calibration only after reset. Running them periodically has caused stability issues on some (primarily AR2315/2413/5413/5414 based) devices, leading to messages such as:
ath5k phy0: gain calibration timeout (2462MHz)
ath5k phy0: calibration of channel 11 failed
Related bug reports:
https://dev.openwrt.org/ticket/10574
https://bugzilla.redhat.com/show_bug.cgi?id=795141
--- drivers/net/wireless/ath/ath5k/phy.c | 34 +++++++++------------------------- 1 files changed, 9 insertions(+), 25 deletions(-)
drivers/net/wireless/ath/ath5k/phy.c +9 -25
@@ -1871,31 +1871,15 @@ ath5k_hw_phy_calibrate(struct ath5k_hw *ah, ret =0 ; } -/* On full calibration do an AGC calibration and -* request a PAPD probe for gainf calibration if -* needed */ -if (ah->ah_cal_mask &AR5K_CALIBRATION_FULL ) { - -AR5K_REG_ENABLE_BITS (ah,AR5K_PHY_AGCCTL , -AR5K_PHY_AGCCTL_CAL ); - - ret =ath5k_hw_register_timeout (ah,AR5K_PHY_AGCCTL , -AR5K_PHY_AGCCTL_CAL |AR5K_PHY_AGCCTL_NF , -0 , false); -if (ret) { -ATH5K_ERR (ah, -"gain calibration timeout (%uMHz)\n" , - channel->center_freq); - } - -if ((ah->ah_radio ==AR5K_RF5111 || - ah->ah_radio ==AR5K_RF5112 ) - && (channel->hw_value !=AR5K_MODE_11B )) -ath5k_hw_request_rfgain_probe (ah); - } - -/* Update noise floor -* XXX: Only do this after AGC calibration */ +/* On full calibration request a PAPD probe for +* gainf calibration if needed */ +if ((ah->ah_cal_mask &AR5K_CALIBRATION_FULL ) && + (ah->ah_radio ==AR5K_RF5111 || + ah->ah_radio ==AR5K_RF5112 ) && + channel->hw_value !=AR5K_MODE_11B ) +ath5k_hw_request_rfgain_probe (ah); + +/* Update noise floor */ if (!(ah->ah_cal_mask &AR5K_CALIBRATION_NF ))ath5k_hw_update_noise_floor (ah);
Signature · 1 line
1.7.3.2