mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH wireless-next] wifi: rt2x00: rt2800lib: fallback to default RF config when EEPROM_NIC_CONF0 is 0x0000
@ 2026-10-30 23:57 Alessandro Petrozzelli via B4 Relay
  2026-10-31  7:50 ` Stanislaw Gruszka
  0 siblings, 1 reply; 2+ messages in thread
From: Alessandro Petrozzelli via B4 Relay @ 2026-10-30 23:57 UTC (permalink / raw)
  To: Stanislaw Gruszka, Johannes Berg
  Cc: linux-wireless, linux-kernel, Alessandro Petrozzelli

From: Alessandro Petrozzelli <apetrozzelli@gmail.com>

On some Ralink PCI/PCIe wireless cards, such as the AzureWave AW-NE766
(Ralink RT2790 / RT2872, PCI ID 1814:0781, subsystem 1814:2790) bundled
in the ASUS EeeBox PC B202, reading EEPROM_NIC_CONF0 returns 0x0000
instead of 0xffff when the EEPROM word is uninitialized.

Currently, rt2800_validate_eeprom() only triggers the default RF2820
(1T2R) configuration fallback when EEPROM_NIC_CONF0 is 0xffff, unlike
other EEPROM validation checks in the same function (such as LNA gain
fields) which already check for both 0x00 and 0xff. As a result,
EEPROM_NIC_CONF0_RF_TYPE remains 0x0000 and rt2800_init_eeprom() aborts
device initialization with -ENODEV:

  rt2x00_set_rt: Info - RT chipset 2872, rev 0200 detected
  rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected
  rt2x00lib_probe_dev: Error - Failed to allocate device

Since 0x0000 is never a valid RF_TYPE (valid chipsets start at
RF2820 = 0x0001), extend the EEPROM_NIC_CONF0 fallback check to also
handle 0x0000 so that these cards initialize and operate properly.

Signed-off-by: Alessandro Petrozzelli <apetrozzelli@gmail.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
index 2e2e382b6..dda5ba2ad 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
@@ -11047,7 +11047,7 @@ static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)
 		return retval;
 
 	word = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0);
-	if (word == 0xffff) {
+	if (word == 0xffff || word == 0x0000) {
 		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 2);
 		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_TXPATH, 1);
 		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820);

---
base-commit: 2c50cd5d10e8723797f28c7978f1f61688e0c0d2
change-id: 20261031-fix-rt2800-eeprom-nic-conf0-zero-acf88f6ddd60

Best regards,
--  
Alessandro Petrozzelli <apetrozzelli@gmail.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH wireless-next] wifi: rt2x00: rt2800lib: fallback to default RF config when EEPROM_NIC_CONF0 is 0x0000
  2026-10-30 23:57 [PATCH wireless-next] wifi: rt2x00: rt2800lib: fallback to default RF config when EEPROM_NIC_CONF0 is 0x0000 Alessandro Petrozzelli via B4 Relay
@ 2026-10-31  7:50 ` Stanislaw Gruszka
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2026-10-31  7:50 UTC (permalink / raw)
  To: apetrozzelli; +Cc: Johannes Berg, linux-wireless, linux-kernel

Hi

On Sat, Oct 31, 2026 at 12:57:36AM +0100, Alessandro Petrozzelli via B4 Relay wrote:
> From: Alessandro Petrozzelli <apetrozzelli@gmail.com>
> 
> On some Ralink PCI/PCIe wireless cards, such as the AzureWave AW-NE766
> (Ralink RT2790 / RT2872, PCI ID 1814:0781, subsystem 1814:2790) bundled
> in the ASUS EeeBox PC B202, reading EEPROM_NIC_CONF0 returns 0x0000
> instead of 0xffff when the EEPROM word is uninitialized.
> 
> Currently, rt2800_validate_eeprom() only triggers the default RF2820
> (1T2R) configuration fallback when EEPROM_NIC_CONF0 is 0xffff, unlike
> other EEPROM validation checks in the same function (such as LNA gain
> fields) which already check for both 0x00 and 0xff. As a result,
> EEPROM_NIC_CONF0_RF_TYPE remains 0x0000 and rt2800_init_eeprom() aborts
> device initialization with -ENODEV:
> 
>   rt2x00_set_rt: Info - RT chipset 2872, rev 0200 detected
>   rt2800_init_eeprom: Error - Invalid RF chipset 0x0000 detected
>   rt2x00lib_probe_dev: Error - Failed to allocate device

Please check if your kernel contains:

commit 0a2581cbae9e442835f68d22044157db61cdf54d
Author: Corentin Labbe <clabbe@baylibre.com>
Date:   Fri Jul 3 13:49:32 2026 +0000

    wifi: ralink: RT2X00: init EEPROM properly

The problem could be a issue fixed by this commit and 
other EEPROM values would be read properly.

> Since 0x0000 is never a valid RF_TYPE (valid chipsets start at
> RF2820 = 0x0001), extend the EEPROM_NIC_CONF0 fallback check to also
> handle 0x0000 so that these cards initialize and operate properly.
> 
> Signed-off-by: Alessandro Petrozzelli <apetrozzelli@gmail.com>
> ---
>  drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> index 2e2e382b6..dda5ba2ad 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
> @@ -11047,7 +11047,7 @@ static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)
>  		return retval;
>  
>  	word = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF0);
> -	if (word == 0xffff) {
> +	if (word == 0xffff || word == 0x0000) {
As you pointed, is safe to have this check since 0 is not valid, so ...

Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>

>  		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RXPATH, 2);
>  		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_TXPATH, 1);
>  		rt2x00_set_field16(&word, EEPROM_NIC_CONF0_RF_TYPE, RF2820);
> 
> ---
> base-commit: 2c50cd5d10e8723797f28c7978f1f61688e0c0d2
> change-id: 20261031-fix-rt2800-eeprom-nic-conf0-zero-acf88f6ddd60
> 
> Best regards,
> --  
> Alessandro Petrozzelli <apetrozzelli@gmail.com>
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-31  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 23:57 [PATCH wireless-next] wifi: rt2x00: rt2800lib: fallback to default RF config when EEPROM_NIC_CONF0 is 0x0000 Alessandro Petrozzelli via B4 Relay
2026-10-31  7:50 ` Stanislaw Gruszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®