mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <stf_xl@wp.pl>
To: apetrozzelli@gmail.com
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH wireless-next] wifi: rt2x00: rt2800lib: fallback to default RF config when EEPROM_NIC_CONF0 is 0x0000
Date: Sat, 31 Oct 2026 08:50:47 +0100	[thread overview]
Message-ID: <20261031075047.GA30810@wp.pl> (raw)
In-Reply-To: <20261031-fix-rt2800-eeprom-nic-conf0-zero-v1-1-a118ee775fcb@gmail.com>

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>
> 
> 

      reply	other threads:[~2026-10-31  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-30 23:57 Alessandro Petrozzelli via B4 Relay
2026-10-31  7:50 ` Stanislaw Gruszka [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261031075047.GA30810@wp.pl \
    --to=stf_xl@wp.pl \
    --cc=apetrozzelli@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®