diff mbox series

[2/2] rt2x00: define RF5592 in init_eeprom routine

Message ID 1545919526-4074-2-git-send-email-pozega.tomislav@gmail.com (mailing list archive)
State Rejected
Delegated to: Kalle Valo
Headers show
Series None | expand

Commit Message

Tom Psyborg Dec. 27, 2018, 2:05 p.m. UTC
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(-)

Comments

Stanislaw Gruszka Jan. 2, 2019, 8:37 a.m. UTC | #1
On Thu, Dec 27, 2018 at 03:05:26PM +0100, Tomislav Požega wrote:
> 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(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index 7f813f6..86770e8 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -8839,6 +8839,8 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
>  		rf = RF3322;
>  	else if (rt2x00_rt(rt2x00dev, RT5350))
>  		rf = RF5350;
> +	else if (rt2x00_rt(rt2x00dev, RT5592))
> +		rf = RF5592;

This looks like workaround for the crash and AFICT it is not needed
on upstream code. This most likely is a issue with below openwrt patch:

https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch;h=a98b49c541f5f76e73751c2fd2e5b85559854b87;hb=HEAD

which for some unknown reason set:

rt2x00dev->eeprom_file = &mtd_fw;

which then crash on rt2x00lib_free_eeprom_file() -> release_firmware();

Regards
Stanislaw
Sebastian Gottschall July 6, 2020, 11:14 a.m. UTC | #2
you are wrong. this is not a workaround for the crash (this is just a 
nice side effect). i had the same issue. the problem is that without 
that patch the device RF is not properly detected.
since the device eeprom contains a rev 0. the same issue is present on 
the Buffalo WHR-600D device

<6>rt2800pci 0000:01:00.0: loaded eeprom from mtd device "factory" 
offset 8000
<6>ieee80211 phy1: rt2x00_set_rt: Info - RT chipset 5592, rev 0222 detected
<3>ieee80211 phy1: rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 
detected
<3>ieee80211 phy1: rt2x00lib_probe_dev: Error - Failed to allocate device


so this patch fixes the missdetection of the RF


Sebastian

Am 02.01.2019 um 09:37 schrieb Stanislaw Gruszka:
> On Thu, Dec 27, 2018 at 03:05:26PM +0100, Tomislav Požega wrote:
>> 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(-)
>>
>> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
>> index 7f813f6..86770e8 100644
>> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
>> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
>> @@ -8839,6 +8839,8 @@ static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
>>   		rf = RF3322;
>>   	else if (rt2x00_rt(rt2x00dev, RT5350))
>>   		rf = RF5350;
>> +	else if (rt2x00_rt(rt2x00dev, RT5592))
>> +		rf = RF5592;
> This looks like workaround for the crash and AFICT it is not needed
> on upstream code. This most likely is a issue with below openwrt patch:
>
> https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/kernel/mac80211/patches/rt2x00/604-rt2x00-load-eeprom-on-SoC-from-a-mtd-device-defines-.patch;h=a98b49c541f5f76e73751c2fd2e5b85559854b87;hb=HEAD
>
> which for some unknown reason set:
>
> rt2x00dev->eeprom_file = &mtd_fw;
>
> which then crash on rt2x00lib_free_eeprom_file() -> release_firmware();
>
> Regards
> Stanislaw
>   
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 7f813f6..86770e8 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -8839,6 +8839,8 @@  static int rt2800_init_eeprom(struct rt2x00_dev *rt2x00dev)
 		rf = RF3322;
 	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);