mac80211: rt2x00: define RF5592 in init_eeprom routine
authorDaniel Golle <daniel@makrotopia.org>
Tue, 7 Jul 2020 20:51:58 +0000 (21:51 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Fri, 10 Jul 2020 17:53:52 +0000 (18:53 +0100)
Make sure RF5592 is set for RT5592 chip which apparently sometimes
doesn't have RF defined (but always comes with RF5592).
This patch was originally submitted on linux-wireless by
Tom Psyborg <pozega.tomislav@gmail.com> but got rejected.
Turns out the patch is actually needed.

Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.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

diff --git a/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch b/package/kernel/mac80211/patches/rt2x00/002-rt2x00-define-RF5592-in-init_eeprom-routine.patch
new file mode 100644 (file)
index 0000000..a50a195
--- /dev/null
@@ -0,0 +1,51 @@
+From patchwork Thu Dec 27 14:05:26 2018
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 8bit
+X-Patchwork-Submitter: Tom Psyborg <pozega.tomislav@gmail.com>
+X-Patchwork-Id: 10743707
+X-Patchwork-Delegate: kvalo@adurom.com
+From: =?utf-8?q?Tomislav_Po=C5=BEega?= <pozega.tomislav@gmail.com>
+To: linux-wireless@vger.kernel.org
+Cc: kvalo@codeaurora.org, hauke@hauke-m.de, nbd@nbd.name,
+        john@phrozen.org, sgruszka@redhat.com, daniel@makrotopia.org
+Subject: [PATCH 2/2] rt2x00: define RF5592 in init_eeprom routine
+Date: Thu, 27 Dec 2018 15:05:26 +0100
+Message-Id: <1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com>
+X-Mailer: git-send-email 1.7.0.4
+In-Reply-To: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
+References: <1545919526-4074-1-git-send-email-pozega.tomislav@gmail.com>
+MIME-Version: 1.0
+Sender: linux-wireless-owner@vger.kernel.org
+Precedence: bulk
+List-ID: <linux-wireless.vger.kernel.org>
+X-Mailing-List: linux-wireless@vger.kernel.org
+X-Virus-Scanned: ClamAV using ClamSMTP
+
+This patch fixes following crash on Linksys EA2750 during 5GHz wifi
+init:
+
+[    7.955153] rt2800pci 0000:01:00.0: card - bus=0x1, slot = 0x0 irq=4
+[    7.962259] rt2800pci 0000:01:00.0: loaded eeprom from mtd device "Factory"
+[    7.969435] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected
+[    7.977348] ieee80211 phy0: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected
+[    7.985793] ieee80211 phy0: rt2x00lib_probe_dev: Error - Failed to allocate device
+[    7.993569] CPU 0 Unable to handle kernel paging request at virtual address 00000024, epc == 800c8f54, ra == 80249ff8
+[    8.004408] Oops[#1]:
+
+Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
+---
+ drivers/net/wireless/ralink/rt2x00/rt2800lib.c |    2 ++
+ 1 files changed, 2 insertions(+), 0 deletions(-)
+
+--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
++++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+@@ -9416,6 +9416,8 @@ static int rt2800_init_eeprom(struct rt2
+               rf = RF3853;
+       else if (rt2x00_rt(rt2x00dev, RT5350))
+               rf = RF5350;
++      else if (rt2x00_rt(rt2x00dev, RT5592))
++              rf = RF5592;
+       else
+               rf = rt2x00_get_field16(eeprom, EEPROM_NIC_CONF0_RF_TYPE);
index 5f60b60d95cd2d543cab2ae6fa32b30d9ae9e814..039c6f6afc6a58f37fe42309d9cf14b4d28320cd 100644 (file)
@@ -8,7 +8,7 @@
  
  #include "rt2x00.h"
  #include "rt2800lib.h"
-@@ -9528,6 +9529,17 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9530,6 +9531,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 88ce5ec52964f05a579e396d435a329448e1b567..20452cd8a7a27d26c61fdba7085e126796ba0651 100644 (file)
@@ -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);
-@@ -9557,7 +9596,8 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9559,7 +9598,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,
-@@ -9568,6 +9608,18 @@ static int rt2800_init_eeprom(struct rt2
+@@ -9570,6 +9610,18 @@ static int rt2800_init_eeprom(struct rt2
                              &rt2x00dev->cap_flags);
        }