First git repo commit for the libreCMC project
[librecmc/librecmc.git] / package / kernel / mac80211 / patches / 317-Revert-ath9k_hw-implement-temperature-compensation-s.patch
1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Tue, 11 Oct 2016 19:45:41 +0200
3 Subject: [PATCH] Revert "ath9k_hw: implement temperature compensation support
4  for AR9003+"
5
6 This reverts commit 171f6402e4aa5cd3b8407f82501f7ea21fa54ccc.
7 Some users report that this commit causes a regression in performance
8 under some conditions.
9
10 Signed-off-by: Felix Fietkau <nbd@nbd.name>
11 ---
12
13 --- a/drivers/net/wireless/ath/ath9k/ar9003_calib.c
14 +++ b/drivers/net/wireless/ath/ath9k/ar9003_calib.c
15 @@ -33,7 +33,6 @@ struct coeff {
16  
17  enum ar9003_cal_types {
18         IQ_MISMATCH_CAL = BIT(0),
19 -       TEMP_COMP_CAL = BIT(1),
20  };
21  
22  static void ar9003_hw_setup_calibration(struct ath_hw *ah,
23 @@ -59,12 +58,6 @@ static void ar9003_hw_setup_calibration(
24                 /* Kick-off cal */
25                 REG_SET_BIT(ah, AR_PHY_TIMING4, AR_PHY_TIMING4_DO_CAL);
26                 break;
27 -       case TEMP_COMP_CAL:
28 -               ath_dbg(common, CALIBRATE,
29 -                       "starting Temperature Compensation Calibration\n");
30 -               REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_LOCAL);
31 -               REG_SET_BIT(ah, AR_CH0_THERM, AR_CH0_THERM_START);
32 -               break;
33         default:
34                 ath_err(common, "Invalid calibration type\n");
35                 break;
36 @@ -93,8 +86,7 @@ static bool ar9003_hw_per_calibration(st
37                 /*
38                 * Accumulate cal measures for active chains
39                 */
40 -               if (cur_caldata->calCollect)
41 -                       cur_caldata->calCollect(ah);
42 +               cur_caldata->calCollect(ah);
43                 ah->cal_samples++;
44  
45                 if (ah->cal_samples >= cur_caldata->calNumSamples) {
46 @@ -107,8 +99,7 @@ static bool ar9003_hw_per_calibration(st
47                         /*
48                         * Process accumulated data
49                         */
50 -                       if (cur_caldata->calPostProc)
51 -                               cur_caldata->calPostProc(ah, numChains);
52 +                       cur_caldata->calPostProc(ah, numChains);
53  
54                         /* Calibration has finished. */
55                         caldata->CalValid |= cur_caldata->calType;
56 @@ -323,16 +314,9 @@ static const struct ath9k_percal_data iq
57         ar9003_hw_iqcalibrate
58  };
59  
60 -static const struct ath9k_percal_data temp_cal_single_sample = {
61 -       TEMP_COMP_CAL,
62 -       MIN_CAL_SAMPLES,
63 -       PER_MAX_LOG_COUNT,
64 -};
65 -
66  static void ar9003_hw_init_cal_settings(struct ath_hw *ah)
67  {
68         ah->iq_caldata.calData = &iq_cal_single_sample;
69 -       ah->temp_caldata.calData = &temp_cal_single_sample;
70  
71         if (AR_SREV_9300_20_OR_LATER(ah)) {
72                 ah->enabled_cals |= TX_IQ_CAL;
73 @@ -340,7 +324,7 @@ static void ar9003_hw_init_cal_settings(
74                         ah->enabled_cals |= TX_IQ_ON_AGC_CAL;
75         }
76  
77 -       ah->supp_cals = IQ_MISMATCH_CAL | TEMP_COMP_CAL;
78 +       ah->supp_cals = IQ_MISMATCH_CAL;
79  }
80  
81  #define OFF_UPPER_LT 24
82 @@ -1399,9 +1383,6 @@ static void ar9003_hw_init_cal_common(st
83         INIT_CAL(&ah->iq_caldata);
84         INSERT_CAL(ah, &ah->iq_caldata);
85  
86 -       INIT_CAL(&ah->temp_caldata);
87 -       INSERT_CAL(ah, &ah->temp_caldata);
88 -
89         /* Initialize current pointer to first element in list */
90         ah->cal_list_curr = ah->cal_list;
91  
92 --- a/drivers/net/wireless/ath/ath9k/hw.h
93 +++ b/drivers/net/wireless/ath/ath9k/hw.h
94 @@ -830,7 +830,6 @@ struct ath_hw {
95         /* Calibration */
96         u32 supp_cals;
97         struct ath9k_cal_list iq_caldata;
98 -       struct ath9k_cal_list temp_caldata;
99         struct ath9k_cal_list adcgain_caldata;
100         struct ath9k_cal_list adcdc_caldata;
101         struct ath9k_cal_list *cal_list;