R6220 " Could not find PHY for device 'radio0'" mt76x2

Hi

Have been using OpenWRT on Netgear R6220 from 18.06. Post upgrading to 21.02 I faced issues of looking 2.4G WiFi network and it used to reappear after a power cycle. Since yesterday I couldn't get back the 2.4G WiFi even after multiple cycles and upgrading to 21.02.1 release as well. Below are some logs which I captured up to my knowledge.

root@bkj-gateway:~# dmesg | grep -e pci
[    2.352307] mt7621-pci 1e140000.pcie: Parsing DT failed
[    2.584973] rt2880-pinmux pinctrl: pcie is already enabled
[    2.596067] mt7621-pci-phy 1e149000.pcie-phy: PHY for 0xbe149000 (dual port = 1)
[    2.611011] mt7621-pci-phy 1e14a000.pcie-phy: PHY for 0xbe14a000 (dual port = 0)
[    2.725555] mt7621-pci-phy 1e149000.pcie-phy: Xtal is 40MHz
[    2.736675] mt7621-pci-phy 1e14a000.pcie-phy: Xtal is 40MHz
[    2.847479] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)
[    2.861348] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
[    2.875219] mt7621-pci 1e140000.pcie: PCIE0 enabled
[    2.884941] mt7621-pci 1e140000.pcie: PCI coherence region base: 0x60000000, mask/settings: 0xf0000002
[    2.903656] mt7621-pci 1e140000.pcie: PCI host bridge to bus 0000:00
[    2.916336] pci_bus 0000:00: root bus resource [io  0x1e160000-0x1e16ffff]
[    2.930046] pci_bus 0000:00: root bus resource [mem 0x60000000-0x6fffffff]
[    2.943741] pci_bus 0000:00: root bus resource [bus 00-ff]
[    2.954713] pci 0000:00:00.0: [0e8d:0801] type 01 class 0x060400
[    2.966711] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x7fffffff]
[    2.979205] pci 0000:00:00.0: reg 0x14: [mem 0x60200000-0x6020ffff]
[    2.991778] pci 0000:00:00.0: supports D1
[    2.999780] pci 0000:00:00.0: PME# supported from D0 D1 D3hot
[    3.012999] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
[    3.025033] pci 0000:01:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[    3.038601] pci 0000:01:00.0: reg 0x30: [mem 0x00000000-0x0000ffff pref]
[    3.052056] pci 0000:01:00.0: PME# supported from D0 D3hot D3cold
[    3.065644] pci 0000:00:00.0: PCI bridge to [bus 01-ff]
[    3.076068] pci 0000:00:00.0:   bridge window [io  0x0000-0x0fff]
[    3.088212] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    3.101736] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[    3.116129] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    3.129347] pci 0000:00:00.0: BAR 0: no space for [mem size 0x80000000]
[    3.142532] pci 0000:00:00.0: BAR 0: failed to assign [mem size 0x80000000]
[    3.156405] pci 0000:00:00.0: BAR 8: assigned [mem 0x60000000-0x600fffff]
[    3.169933] pci 0000:00:00.0: BAR 9: assigned [mem 0x60100000-0x601fffff pref]
[    3.184328] pci 0000:00:00.0: BAR 1: assigned [mem 0x60200000-0x6020ffff]
[    3.197857] pci 0000:00:00.0: BAR 7: assigned [io  0x1e160000-0x1e160fff]
[    3.211390] pci 0000:01:00.0: BAR 0: assigned [mem 0x60000000-0x600fffff 64bit]
[    3.225968] pci 0000:01:00.0: BAR 6: assigned [mem 0x60100000-0x6010ffff pref]
[    3.240368] pci 0000:00:00.0: PCI bridge to [bus 01]
[    3.250259] pci 0000:00:00.0:   bridge window [io  0x1e160000-0x1e160fff]
[    3.263802] pci 0000:00:00.0:   bridge window [mem 0x60000000-0x600fffff]
[    3.277324] pci 0000:00:00.0:   bridge window [mem 0x60100000-0x601fffff pref]
[   13.624156] mt7621-pci 1e140000.pcie: bus=1 slot=0 irq=19
[   13.634988] pci 0000:00:00.0: enabling device (0006 -> 0007)

root@bkj-gateway:~# dmesg | grep -e mt76x2
[   13.646286] mt76x2e 0000:01:00.0: enabling device (0000 -> 0002)
[   13.658523] mt76x2e 0000:01:00.0: ASIC revision: 76120044
[   14.072456] mt76x2e 0000:01:00.0: ROM patch build: 20141115060606a
[   14.089665] mt76x2e 0000:01:00.0: Firmware Version: 0.0.00
[   14.100626] mt76x2e 0000:01:00.0: Build: 1
[   14.108787] mt76x2e 0000:01:00.0: Build Time: 201507311614____
[   14.135823] mt76x2e 0000:01:00.0: Firmware running!

Error in logcat related to radio0:

Sun Nov  7 10:00:33 2021 daemon.notice netifd: radio0 (1989): Could not find PHY for device 'radio0'
Sun Nov  7 10:00:33 2021 daemon.notice netifd: radio0 (2101): WARNING: Variable 'data' does not exist or is not an array/object
Sun Nov  7 10:00:33 2021 daemon.notice netifd: radio0 (2101): Bug: PHY is undefined for device 'radio0'

root@bkj-gateway:~# lspci
00:00.0 PCI bridge: Device 0e8d:0801 (rev 01)
01:00.0 Network controller: MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter

root@bkj-gateway:~# iwinfo
wlan0     ESSID: "BKJ_5G"
          Access Point: 10:DA:43:DC:A3:A4
          Mode: Master  Channel: 60 (5.300 GHz)
          Center Channel 1: 58 2: unknown
          Tx-Power: 24 dBm  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: mixed WPA2/WPA3 PSK/SAE (CCMP)
          Type: nl80211  HW Mode(s): 802.11nac
          Hardware: 14C3:7662 14C3:7662 [MediaTek MT76x2E]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0


/etc/config/wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option path '1e140000.pcie/pci0000:00/0000:00:01.0/0000:02:00.0'
        option cell_density '0'
        option country 'IN'
        option beacon_int '1000'
        option hwmode '11a'
        option distance '50'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11a'
        option path '1e140000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
        option htmode 'VHT80'
        option country 'IN'
        option cell_density '2'
        option channel '60'

Seems like there's something going wrong with the PCIe reset on PCIe 1, similar to what happened here:

Could you compile an image with this patch applied? If that doesn't work, try GPIO 7 instead of 8.

diff --git a/target/linux/ramips/dts/mt7621_netgear_r6220.dts b/target/linux/ramips/dts/mt7621_netgear_r6220.dts
index 54489243b8..a12009d298 100644
--- a/target/linux/ramips/dts/mt7621_netgear_r6220.dts
+++ b/target/linux/ramips/dts/mt7621_netgear_r6220.dts
@@ -55,6 +55,13 @@
        };
 };
 
+&pcie {
+       status = "okay";
+
+       reset-gpios = <&gpio 19 GPIO_ACTIVE_LOW>,
+                     <&gpio 8 GPIO_ACTIVE_LOW>;
+}
+
 &gmac0 {
        nvmem-cells = <&macaddr_factory_4>;
        nvmem-cell-names = "mac-address";

Thank you, but I haven't done a build/compile myself. Let me explore to see if I can accomplish this.

Upgrading from 18.06 to 21.02 is not supported. I would suggest to go back to OEM firmware using nmrpflash, and than flash 21.02. You will have a clean install with no old settings remaining.

Sure you can as long as you wipe your settings (I suppose he did that, otherwise he would have no wired access).

I have done upgrades and never gone back to stock firmware. Will try this out this week end and report the outcome.

Have you read this chapter ?

Bad eraseblocks and resulting Wifi/MAC troubles in OpenWrt 18.06

Upgrading along from 18.06 to 21.02 may have left some elements. That is why I recommend to reverse to OEM firmware, and than flash openWrt. This bug has been solved in 19.07 and so 21.02.
I will only take a couple of minutes, and you will have a device clean of any remains of old settings.

1 Like

You're raising a fair point, and caution is always good, but the bad block issue causes wireless calibration data errors, not the physical hardware not being found, according to your wiki link. It would surprise me if bad blocks cause the latter.

Agreed. Starting from OEM firmware and installing from scratch should solve any issue, assuming the device hasn't a hardware fault.

1 Like

Have flashed OEM firmware v 1.1.0.110 using nmrpflash. Rebooted and tested the 2.4G connectivity. It was stable. Post which, flashed OpenWrt 21.02.1 Factory img file and rebooted. On first boot could detect the 2.4G Wireless card. Post configuration and reboot the card vanished.

Repeated the above process again to be sure that I didn't mess up. 2.4G wireless works fine in OEM firmware but post installing OpenWRT, it vanished again.

One observation I had is that when flashing OpenWRT was getting a warning that I am flashing a lower version of the firmware 1.0.0.86.

Currently I left it with OpenWRT as I have the configuration in place, which I won't be able to revert to OEM firmware. Can support with logs for deep diving into the issue here.

Update:

Was trying to read through the wireless config file - /etc/config/wireless and found that "hwmode" for radio0 was set to '11a'. I changed it to '11g' and rebooted. 2.4G interface came up and is working now. Not sure how it got set to '11a' in first place. Performed couple of reboots and could see the interface is coming up properly. Will monitor for a week to see if it misbehaves.

1 Like

I have read your "adventures", and agree with all you have done.

Nothing to worry about. Openwrt is badly recognized by OEM firmware when selecting file.

So you have restored OEM, and flashed openWrt 21.0.1 factory image, twice. And still have the same issue ? Than it may be a bad setting into default factory image. I have switched all my devices to 21.02 RC1 factory six months ago, than I have always used upgrading. And furthermore, I use a custom build.

Let's assume that you have solved the issue. I will try to perform the same process to one device when I have time, and check if I have the same wifi mode set to '11a'.

I have just performed a reset to OEM (nmrpflash), and than installed the default OpenWrt 21.02.1. The radio0 has hwmode set to '11g' as expected. I was not able to reproduce your issue.

During my first attempt I restored the configuration from backup in OpenWRT. But during the second attempt I didn't restore, looks like it picked up a stale config.

Just checked an old backup from 21.02 RC2, hwmode is correctly set as 11g in that.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.