317-Revert-ath9k_hw-implement-temperature-compensation-s.patch 3.0 KB

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