331-ath9k_hw-do-not-run-NF-and-periodic-calibration-at-t.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From: Felix Fietkau <[email protected]>
  2. Date: Sat, 18 Oct 2014 13:39:11 +0200
  3. Subject: [PATCH] ath9k_hw: do not run NF and periodic calibration at the
  4. same time
  5. It can cause inconsistent calibration results or in some cases turn the
  6. radio deaf.
  7. Signed-off-by: Felix Fietkau <[email protected]>
  8. ---
  9. --- a/drivers/net/wireless/ath/ath9k/ar9002_calib.c
  10. +++ b/drivers/net/wireless/ath/ath9k/ar9002_calib.c
  11. @@ -660,7 +660,6 @@ static void ar9002_hw_olc_temp_compensat
  12. static int ar9002_hw_calibrate(struct ath_hw *ah, struct ath9k_channel *chan,
  13. u8 rxchainmask, bool longcal)
  14. {
  15. - bool iscaldone = true;
  16. struct ath9k_cal_list *currCal = ah->cal_list_curr;
  17. bool nfcal, nfcal_pending = false;
  18. int ret;
  19. @@ -672,15 +671,13 @@ static int ar9002_hw_calibrate(struct at
  20. if (currCal && !nfcal &&
  21. (currCal->calState == CAL_RUNNING ||
  22. currCal->calState == CAL_WAITING)) {
  23. - iscaldone = ar9002_hw_per_calibration(ah, chan,
  24. - rxchainmask, currCal);
  25. - if (iscaldone) {
  26. - ah->cal_list_curr = currCal = currCal->calNext;
  27. -
  28. - if (currCal->calState == CAL_WAITING) {
  29. - iscaldone = false;
  30. - ath9k_hw_reset_calibration(ah, currCal);
  31. - }
  32. + if (!ar9002_hw_per_calibration(ah, chan, rxchainmask, currCal))
  33. + return 0;
  34. +
  35. + ah->cal_list_curr = currCal = currCal->calNext;
  36. + if (currCal->calState == CAL_WAITING) {
  37. + ath9k_hw_reset_calibration(ah, currCal);
  38. + return 0;
  39. }
  40. }
  41. @@ -710,7 +707,7 @@ static int ar9002_hw_calibrate(struct at
  42. }
  43. }
  44. - return iscaldone;
  45. + return 1;
  46. }
  47. /* Carrier leakage Calibration fix */