]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ralink: RT2X00: init EEPROM properly
authorCorentin Labbe <clabbe@baylibre.com>
Fri, 3 Jul 2026 13:49:32 +0000 (13:49 +0000)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Jul 2026 12:11:08 +0000 (14:11 +0200)
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>
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20260703134932.3786771-1-clabbe@baylibre.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ralink/rt2x00/rt2400pci.c
drivers/net/wireless/ralink/rt2x00/rt2500pci.c
drivers/net/wireless/ralink/rt2x00/rt2800pci.c
drivers/net/wireless/ralink/rt2x00/rt61pci.c

index cac191304bf5f29d8e37e8e0071337a42951756a..b846fe589c2ba0da2fb0ec34f792621bcfd31171 100644 (file)
@@ -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;
index fc35b60e422c03c0efd83ffd3a784efe993fbd65..be9df35acc33b7ff3107610a63ccc1659c0234d8 100644 (file)
@@ -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;
index 4fa14bb573add555a2880084237bb730987ef436..2596b9fcc7dd344daa40346f18dc78e4e0abf2a4 100644 (file)
@@ -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);
index 79e1fd0a1fbdd7a8edb08eff77e70c7e2980ebae..d4783658b2c5dbb69ab6c715a23ac8814ef3afb0 100644 (file)
@@ -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;