mac80211: rt2x00: revert commit causing regression in 5GHz band
authorDaniel Golle <daniel@makrotopia.org>
Thu, 29 Aug 2019 20:26:42 +0000 (22:26 +0200)
committerDaniel Golle <daniel@makrotopia.org>
Thu, 29 Aug 2019 20:29:54 +0000 (22:29 +0200)
From: Stanislaw Gruszka <sgruszka@redhat.com>
This reverts commit 9ad3b55654455258a9463384edb40077439d879f.

As reported by Sergey:

"I got some problem after upgrade kernel to 5.2 version (debian testing
linux-image-5.2.0-2-amd64). 5Ghz client  stopped to see AP.
Some tests with 1metre distance between client-AP: 2.4Ghz  -22dBm, for
5Ghz - 53dBm !, for longer distance (8m + walls) 2.4 - 61dBm, 5Ghz not
visible."

It was identified that rx signal level degradation was caused by
9ad3b5565445 ("rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band").
So revert this commit.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/kernel/mac80211/patches/rt2x00/016-rt2x00-revert-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch [new file with mode: 0644]
package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch
package/kernel/mac80211/patches/rt2x00/650-rt2x00-add-support-for-external-PA-on-MT7620.patch
package/kernel/mac80211/patches/rt2x00/982-rt2x00-add-rf-self-txdc-calibration.patch
package/kernel/mac80211/patches/rt2x00/983-rt2x00-add-r-calibration.patch
package/kernel/mac80211/patches/rt2x00/984-rt2x00-add-rxdcoc-calibration.patch
package/kernel/mac80211/patches/rt2x00/985-rt2x00-add-rxiq-calibration.patch
package/kernel/mac80211/patches/rt2x00/986-rt2x00-add-TX-LOFT-calibration.patch

diff --git a/package/kernel/mac80211/patches/rt2x00/016-rt2x00-revert-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch b/package/kernel/mac80211/patches/rt2x00/016-rt2x00-revert-rt2800-enable-TX_PIN_CFG_LNA_PE_-bits-per-band.patch
new file mode 100644 (file)
index 0000000..3fcf231
--- /dev/null
@@ -0,0 +1,70 @@
+From patchwork Thu Aug 29 11:29:59 2019
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+X-Patchwork-Submitter: Stanislaw Gruszka <sgruszka@redhat.com>
+X-Patchwork-Id: 11121089
+X-Patchwork-Delegate: kvalo@adurom.com
+From: Stanislaw Gruszka <sgruszka@redhat.com>
+To: linux-wireless@vger.kernel.org
+Subject: [PATCH 5.3] Revert "rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band"
+Date: Thu, 29 Aug 2019 13:29:59 +0200
+Message-Id: <1567078199-3645-1-git-send-email-sgruszka@redhat.com>
+Sender: linux-wireless-owner@vger.kernel.org
+List-ID: <linux-wireless.vger.kernel.org>
+X-Mailing-List: linux-wireless@vger.kernel.org
+
+This reverts commit 9ad3b55654455258a9463384edb40077439d879f.
+
+As reported by Sergey:
+
+"I got some problem after upgrade kernel to 5.2 version (debian testing
+linux-image-5.2.0-2-amd64). 5Ghz client  stopped to see AP.
+Some tests with 1metre distance between client-AP: 2.4Ghz  -22dBm, for
+5Ghz - 53dBm !, for longer distance (8m + walls) 2.4 - 61dBm, 5Ghz not
+visible."
+
+It was identified that rx signal level degradation was caused by
+9ad3b5565445 ("rt2800: enable TX_PIN_CFG_LNA_PE_ bits per band").
+So revert this commit.
+
+Cc: <stable@vger.kernel.org> # v5.1+
+Reported-and-tested-by: Sergey Maranchuk <slav0nic0@gmail.com>
+Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
+---
+ drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 18 ++++++------------
+ 1 file changed, 6 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+@@ -4242,24 +4242,18 @@ static void rt2800_config_channel(struct
+       switch (rt2x00dev->default_ant.rx_chain_num) {
+       case 3:
+               /* Turn on tertiary LNAs */
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN,
+-                                 rf->channel > 14);
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN,
+-                                 rf->channel <= 14);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A2_EN, 1);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G2_EN, 1);
+               /* fall-through */
+       case 2:
+               /* Turn on secondary LNAs */
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN,
+-                                 rf->channel > 14);
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN,
+-                                 rf->channel <= 14);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A1_EN, 1);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G1_EN, 1);
+               /* fall-through */
+       case 1:
+               /* Turn on primary LNAs */
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN,
+-                                 rf->channel > 14);
+-              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN,
+-                                 rf->channel <= 14);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_A0_EN, 1);
++              rt2x00_set_field32(&tx_pin, TX_PIN_CFG_LNA_PE_G0_EN, 1);
+               break;
+       }
index 93043dc61677dc7559667c063870ccb28c79c7f9..0efd3a157d4e3ecfc35f70b9dbb40f9f072b418d 100644 (file)
@@ -8,7 +8,7 @@
  
  #include "rt2x00.h"
  #include "rt2800lib.h"
-@@ -9540,6 +9541,17 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9534,6 +9535,17 @@ static int rt2800_init_eeprom(struct rt2
        rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC);
        rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY);
  
index 55c256a2f83ce91347643aef96459554c0131736..9bbf2ad07e68445d9aa7e1b8eda6b90683215b4c 100644 (file)
@@ -30,7 +30,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
   * EEPROM LNA
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -4365,6 +4365,45 @@ static void rt2800_config_channel(struct
+@@ -4359,6 +4359,45 @@ static void rt2800_config_channel(struct
                rt2800_iq_calibrate(rt2x00dev, rf->channel);
        }
  
@@ -76,7 +76,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
        bbp = rt2800_bbp_read(rt2x00dev, 4);
        rt2x00_set_field8(&bbp, BBP4_BANDWIDTH, 2 * conf_is_ht40(conf));
        rt2800_bbp_write(rt2x00dev, 4, bbp);
-@@ -9569,7 +9608,8 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9563,7 +9602,8 @@ static int rt2800_init_eeprom(struct rt2
         */
        eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
  
@@ -86,7 +86,7 @@ Signed-off-by: Tomislav Po=C5=BEega <pozega.tomislav@gmail.com>
                if (rt2x00_get_field16(eeprom,
                    EEPROM_NIC_CONF1_EXTERNAL_TX0_PA_3352))
                    __set_bit(CAPABILITY_EXTERNAL_PA_TX0,
-@@ -9580,6 +9620,18 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9574,6 +9614,18 @@ static int rt2800_init_eeprom(struct rt2
                              &rt2x00dev->cap_flags);
        }
  
index 40d44b648c8b54887b772dcd4bc063a971e5c014..38558885ac588e8e77d43058c27964861f769978 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8431,6 +8431,58 @@ static void rt2800_init_rfcsr_5592(struc
+@@ -8425,6 +8425,58 @@ static void rt2800_init_rfcsr_5592(struc
        rt2800_led_open_drain_enable(rt2x00dev);
  }
  
@@ -59,7 +59,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
                                       bool set_bw, bool is_ht40)
  {
-@@ -9038,6 +9090,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9032,6 +9084,7 @@ static void rt2800_init_rfcsr_6352(struc
        rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
        rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
  
index dd0ab2c4ecf831c052ecc626019f19832b8ffb54..e56044f88202f6c535008bdc23bb1da346c87ecb 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8483,6 +8483,160 @@ void rt2800_rf_self_txdc_cal(struct rt2x
+@@ -8477,6 +8477,160 @@ void rt2800_rf_self_txdc_cal(struct rt2x
  }
  EXPORT_SYMBOL_GPL(rt2800_rf_self_txdc_cal);
  
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
                                       bool set_bw, bool is_ht40)
  {
-@@ -9090,6 +9244,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9084,6 +9238,7 @@ static void rt2800_init_rfcsr_6352(struc
        rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
        rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
  
index c4f184efc55ea0e98e8a6788f75bb882bc7f1f6e..79cc7807b2815e142bcd8b05a0d7441adfcbc981 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8637,6 +8637,71 @@ void rt2800_r_calibration(struct rt2x00_
+@@ -8631,6 +8631,71 @@ void rt2800_r_calibration(struct rt2x00_
  }
  EXPORT_SYMBOL_GPL(rt2800_r_calibration);
  
@@ -72,7 +72,7 @@
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
                                       bool set_bw, bool is_ht40)
  {
-@@ -9246,6 +9311,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9240,6 +9305,7 @@ static void rt2800_init_rfcsr_6352(struc
  
        rt2800_r_calibration(rt2x00dev);
        rt2800_rf_self_txdc_cal(rt2x00dev);
index ca21f55beef37dd3eacf1f1e748b7dea3f2ee97a..01bed89a6397bbd3e4bde6f2edd2f64ac1132ab3 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8702,6 +8702,386 @@ void rt2800_rxdcoc_calibration(struct rt
+@@ -8696,6 +8696,386 @@ void rt2800_rxdcoc_calibration(struct rt
  }
  EXPORT_SYMBOL_GPL(rt2800_rxdcoc_calibration);
  
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
                                       bool set_bw, bool is_ht40)
  {
-@@ -9314,6 +9694,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9308,6 +9688,7 @@ static void rt2800_init_rfcsr_6352(struc
        rt2800_rxdcoc_calibration(rt2x00dev);
        rt2800_bw_filter_calibration(rt2x00dev, true);
        rt2800_bw_filter_calibration(rt2x00dev, false);
index 89b49325de03685b01590491fb72847c1368bd71..eca6573457f6aef18aaf41beec5f3b9b63ef94e0 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
 +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -9082,6 +9082,954 @@ restore_value:
+@@ -9076,6 +9076,954 @@ restore_value:
  }
  EXPORT_SYMBOL_GPL(rt2800_rxiq_calibration);
  
  static void rt2800_bbp_core_soft_reset(struct rt2x00_dev *rt2x00dev,
                                       bool set_bw, bool is_ht40)
  {
-@@ -9694,6 +10642,7 @@ static void rt2800_init_rfcsr_6352(struc
+@@ -9688,6 +10636,7 @@ static void rt2800_init_rfcsr_6352(struc
        rt2800_rxdcoc_calibration(rt2x00dev);
        rt2800_bw_filter_calibration(rt2x00dev, true);
        rt2800_bw_filter_calibration(rt2x00dev, false);