Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] net: wireless: ralink: RT2X00: init EEPROM properly
@ 2026-07-03 13:49 Corentin Labbe
  2026-07-03 19:17 ` Stanislaw Gruszka
  0 siblings, 1 reply; 2+ messages in thread
From: Corentin Labbe @ 2026-07-03 13:49 UTC (permalink / raw)
  To: stf_xl; +Cc: linux-kernel, linux-wireless, Corentin Labbe

I have an hostapd setup with a
01:00.0 Network controller: Ralink corp. RT2790 Wireless 802.11n 1T/2R PCIe

The setup work fine on 6.18.26-gentoo
It breaks on 6.18.33-gentoo (and still broken on 6.18.37)

I found an hint in dmesg:
On 6.18.26-gentoo I see:
May 31 15:48:45 trash01 kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0003 detected
On 6.18.33-gentoo I see:
May 31 15:22:57 trash01 kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0006 detected

The RF chipset seems badly detected.

The problem was the EEPROM which was badly initialized.
Probably the origin was in some PCI change but unfortunately I couldn't play
to bisect/reboot often the board with this card to do it.

Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
---
 drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2500pci.c | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 2 +-
 drivers/net/wireless/ralink/rt2x00/rt61pci.c   | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
index 42e21e9f303b..15073b856adf 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
@@ -1429,7 +1429,7 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
  */
 static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
 {
-	struct eeprom_93cx6 eeprom;
+	struct eeprom_93cx6 eeprom = {};
 	u32 reg;
 	u16 word;
 	u8 *mac;
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
index 36ddc5a69fa4..3536a0f31117 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
@@ -1555,7 +1555,7 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
  */
 static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
 {
-	struct eeprom_93cx6 eeprom;
+	struct eeprom_93cx6 eeprom = {};
 	u32 reg;
 	u16 word;
 	u8 *mac;
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
index 14c45aba836f..853fd31d1362 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
@@ -108,7 +108,7 @@ static void rt2800pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
 
 static int rt2800pci_read_eeprom_pci(struct rt2x00_dev *rt2x00dev)
 {
-	struct eeprom_93cx6 eeprom;
+	struct eeprom_93cx6 eeprom = {};
 	u32 reg;
 
 	reg = rt2x00mmio_register_read(rt2x00dev, E2PROM_CSR);
diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
index d1cd5694e3c7..5dca2afb4b96 100644
--- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
@@ -2298,7 +2298,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
  */
 static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
 {
-	struct eeprom_93cx6 eeprom;
+	struct eeprom_93cx6 eeprom = {};
 	u32 reg;
 	u16 word;
 	u8 *mac;
-- 
2.53.0


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

* Re: [PATCH] net: wireless: ralink: RT2X00: init EEPROM properly
  2026-07-03 13:49 [PATCH] net: wireless: ralink: RT2X00: init EEPROM properly Corentin Labbe
@ 2026-07-03 19:17 ` Stanislaw Gruszka
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislaw Gruszka @ 2026-07-03 19:17 UTC (permalink / raw)
  To: Corentin Labbe; +Cc: linux-kernel, linux-wireless

Hi,

On Fri, Jul 03, 2026 at 01:49:32PM +0000, Corentin Labbe wrote:
> I have an hostapd setup with a
> 01:00.0 Network controller: Ralink corp. RT2790 Wireless 802.11n 1T/2R PCIe
> 
> The setup work fine on 6.18.26-gentoo
> It breaks on 6.18.33-gentoo (and still broken on 6.18.37)
> 
> I found an hint in dmesg:
> On 6.18.26-gentoo I see:
> May 31 15:48:45 trash01 kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0003 detected
> On 6.18.33-gentoo I see:
> May 31 15:22:57 trash01 kernel: ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 0006 detected
> 
> The RF chipset seems badly detected.
> 
> The problem was the EEPROM which was badly initialized.

Good catch. Some new fields were added to struct eeprom_93cx6, but
the rt2x00 driver was not updated to initalize those.

> Probably the origin was in some PCI change but unfortunately I couldn't play
> to bisect/reboot often the board with this card to do it.
> 
> Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Cc: stable@vger.kernel.org

> ---
>  drivers/net/wireless/ralink/rt2x00/rt2400pci.c | 2 +-
>  drivers/net/wireless/ralink/rt2x00/rt2500pci.c | 2 +-
>  drivers/net/wireless/ralink/rt2x00/rt2800pci.c | 2 +-
>  drivers/net/wireless/ralink/rt2x00/rt61pci.c   | 2 +-
>  4 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
> index 42e21e9f303b..15073b856adf 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2400pci.c
> @@ -1429,7 +1429,7 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance)
>   */
>  static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
>  {
> -	struct eeprom_93cx6 eeprom;
> +	struct eeprom_93cx6 eeprom = {};
>  	u32 reg;
>  	u16 word;
>  	u8 *mac;
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
> index 36ddc5a69fa4..3536a0f31117 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2500pci.c
> @@ -1555,7 +1555,7 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
>   */
>  static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
>  {
> -	struct eeprom_93cx6 eeprom;
> +	struct eeprom_93cx6 eeprom = {};
>  	u32 reg;
>  	u16 word;
>  	u8 *mac;
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
> index 14c45aba836f..853fd31d1362 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
> @@ -108,7 +108,7 @@ static void rt2800pci_eepromregister_write(struct eeprom_93cx6 *eeprom)
>  
>  static int rt2800pci_read_eeprom_pci(struct rt2x00_dev *rt2x00dev)
>  {
> -	struct eeprom_93cx6 eeprom;
> +	struct eeprom_93cx6 eeprom = {};
>  	u32 reg;
>  
>  	reg = rt2x00mmio_register_read(rt2x00dev, E2PROM_CSR);
> diff --git a/drivers/net/wireless/ralink/rt2x00/rt61pci.c b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
> index d1cd5694e3c7..5dca2afb4b96 100644
> --- a/drivers/net/wireless/ralink/rt2x00/rt61pci.c
> +++ b/drivers/net/wireless/ralink/rt2x00/rt61pci.c
> @@ -2298,7 +2298,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance)
>   */
>  static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
>  {
> -	struct eeprom_93cx6 eeprom;
> +	struct eeprom_93cx6 eeprom = {};
>  	u32 reg;
>  	u16 word;
>  	u8 *mac;
> -- 
> 2.53.0
> 

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

end of thread, other threads:[~2026-07-03 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-03 13:49 [PATCH] net: wireless: ralink: RT2X00: init EEPROM properly Corentin Labbe
2026-07-03 19:17 ` Stanislaw Gruszka

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