diff mbox series

[RESEND,01/15] rt2x00: define RF5592 in init_eeprom routine

Message ID YyUA9QVEM+D2VOL4@makrotopia.org
State Superseded
Headers show
Series [RESEND,01/15] rt2x00: define RF5592 in init_eeprom routine | expand

Commit Message

Daniel Golle Sept. 16, 2022, 11:04 p.m. UTC
From: Tomislav Požega <pozega.tomislav@gmail.com>

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 file changed, 2 insertions(+)

Comments

Stanislaw Gruszka Sept. 17, 2022, 1:10 p.m. UTC | #1
On Sat, Sep 17, 2022 at 12:04:21AM +0100, Daniel Golle wrote:
> From: Tomislav Požega <pozega.tomislav@gmail.com>
> 
> 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>

Please add your's signed-off-by and fix the changelog. Patch
fixes  incorrect rf value encoded in eeprom, not a crash. IIRC
crash itself was caused by incorrect rt2x00->eeprom_file pointer,
happend when rt2800_init_eeprom() returned error. And should
be alredy fixed in openwrt tree.
Stanislaw Gruszka Sept. 17, 2022, 1:21 p.m. UTC | #2
On Sat, Sep 17, 2022 at 03:10:53PM +0200, Stanislaw Gruszka wrote:
> On Sat, Sep 17, 2022 at 12:04:21AM +0100, Daniel Golle wrote:
> > From: Tomislav Požega <pozega.tomislav@gmail.com>
> > 
> > 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>
> 
> Please add your's signed-off-by and fix the changelog. Patch
> fixes  incorrect rf value encoded in eeprom, not a crash. IIRC
> crash itself was caused by incorrect rt2x00->eeprom_file pointer,
> happend when rt2800_init_eeprom() returned error. And should
> be alredy fixed in openwrt tree.

The crash was fixed by:
https://patchwork.ozlabs.org/project/openwrt/patch/1551000198-30901-1-git-send-email-sgruszka@redhat.com/
Daniel Golle Sept. 17, 2022, 1:28 p.m. UTC | #3
On Sat, Sep 17, 2022 at 03:21:34PM +0200, Stanislaw Gruszka wrote:
> On Sat, Sep 17, 2022 at 03:10:53PM +0200, Stanislaw Gruszka wrote:
> > On Sat, Sep 17, 2022 at 12:04:21AM +0100, Daniel Golle wrote:
> > > From: Tomislav Požega <pozega.tomislav@gmail.com>
> > > 
> > > 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>
> > 
> > Please add your's signed-off-by and fix the changelog. Patch
> > fixes  incorrect rf value encoded in eeprom, not a crash. IIRC
> > crash itself was caused by incorrect rt2x00->eeprom_file pointer,
> > happend when rt2800_init_eeprom() returned error. And should
> > be alredy fixed in openwrt tree.
> 
> The crash was fixed by:
> https://patchwork.ozlabs.org/project/openwrt/patch/1551000198-30901-1-git-send-email-sgruszka@redhat.com/

Yes, the itself has been fixed. For working wifi it's just the RF
value in EEPROM which needs overriding with RT5592 PCIe radio (a single
chip with built-in RF frontend), which is also what the vendor driver
does afair. I will update the commit message in v2.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 18102fbe36d6cc..cc9c5554fdc9ca 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -9435,6 +9435,8 @@  static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
 		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);