MT7621 PCIe DTS issues. (MT76 stopped working with latest updates)

So if mt7621 routers are using pcie1 and 2, that's a bug in the DTS files.

  • Changing pcie0 to pcie1/mt761,0 and pcie1 to pcie2/mt762,0 has no effect. But maybe the mt76-nodes should not be updated? I will test on my device.
  • When looking at dmesg, the pci device-paths are the same for the two wifi radios on the WE1326 and WG3526 (one is at 0000:01:00.0 and the other at 0000:02:00.0).

Changing pcie0 to pcie1/mt761,0 and pcie1 to pcie2/mt762,0 has no effect. But maybe the mt76-nodes should not be updated? I will test on my device.

I test this again, both with and without updating the mt76 noedes. Changing pcie has no effect, but maybe I am missing something.

I can’t test it now, but just a thought on PCIe0. Very likely this is wired to the PCIe slot (at least in the ZBT) for an extra 3g/4g/LTE card. I don’t have a unit with this option. The card is ordered but is still “shipping”.

I have two variants of the same board, one in which the wifi is surface mounted, and the other where they are mPCIe slots. They both show up in almost the same way. On the smt board they are 0000:01:00.00 and 0000:02:00.0, on the board with the slots they are 2 and 3. Both boards have a pcie slot used for LTE

After reverted NeilBrown's patches I can see both phy0 and phy1 but no wifi can be brought up:

Fri Jun  1 13:40:06 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Fri Jun  1 13:40:06 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->DISABLED
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan0: AP-DISABLED
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Fri Jun  1 13:40:06 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio1 (14823): cat: can't open '/var/run/wifi-phy0.pid': No such file or directory
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio1 (14823): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio1 (14823): Command failed: Invalid argument
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio1 (14823): Device setup failed: HOSTAPD_START_FAILED
Fri Jun  1 13:40:06 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Fri Jun  1 13:40:06 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->DISABLED
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan1: AP-DISABLED
Fri Jun  1 13:40:06 2018 daemon.notice hostapd: wlan1: CTRL-EVENT-TERMINATING
Fri Jun  1 13:40:06 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan1 wasn't started
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio0 (14822): cat: can't open '/var/run/wifi-phy1.pid': No such file or directory
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio0 (14822): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio0 (14822): Command failed: Invalid argument
Fri Jun  1 13:40:06 2018 daemon.notice netifd: radio0 (14822): Device setup failed: HOSTAPD_START_FAILED

I'm having something similar

Fri Jun  1 13:08:46 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Fri Jun  1 13:08:46 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Fri Jun  1 13:08:46 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 13:08:46 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->DISABLED
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->DISABLED
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan1: AP-DISABLED
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan0: AP-DISABLED
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Fri Jun  1 13:08:46 2018 daemon.notice hostapd: wlan1: CTRL-EVENT-TERMINATING
Fri Jun  1 13:08:46 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan1 wasn't started
Fri Jun  1 13:08:46 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio0 (1187): cat: can't open '/var/run/wifi-phy0.pid': No such file or directory
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio1 (1189): cat: can't open '/var/run/wifi-phy1.pid': No such file or directory
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio0 (1187): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio1 (1189): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio0 (1187): Command failed: Invalid argument
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio1 (1189): Command failed: Invalid argument
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio1 (1189): Device setup failed: HOSTAPD_START_FAILED
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio0 (1187): Device setup failed: HOSTAPD_START_FAILED
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio1 (1189): cat: can't open '/var/run/wifi-phy1.pid': No such file or directory
Fri Jun  1 13:08:46 2018 daemon.notice netifd: radio0 (1188): cat: can't open '/var/run/wifi-phy0.pid': No such file or directory

There is a hostapd-phyX.conf, but no wifi-phyX.pid file

The proper values should be shown by lspci from pciutils. On my board, pcie stuff is 0,1,2 and devices are 1,2,3.

On ZBT1326 5G is on bus1 with INT24, 2.4Ghz is on bus2 with INT25, both are up, however 2.4G can not connect. I noticed via 'wifi status' that 5Ghz is phy1-radio0-wlan1 while 2.4Ghz is phy0-radio1-wlan0, the naming seems confusing to me. will work on this later.

01:00.0 Network controller: MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter
	Subsystem: MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter
	Flags: bus master, fast devsel, latency 0, IRQ 24
	Memory at 60000000 (64-bit, non-prefetchable) [size=1048577]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	[virtual] Expansion ROM at 60100000 [disabled] [size=65537]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [148] Device Serial Number 00-00-00-00-00-00-00-00
	Capabilities: [158] Latency Tolerance Reporting
	Capabilities: [160] L1 PM Substates
	Kernel driver in use: mt76x2e

02:00.0 Network controller: MEDIATEK Corp. Device 7603
	Subsystem: MEDIATEK Corp. Device 7603
	Flags: bus master, fast devsel, latency 0, IRQ 25
	Memory at 60200000 (32-bit, non-prefetchable) [size=1048577]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Memory at <unassigned> (32-bit, non-prefetchable) [size=2]
	Expansion ROM at <unassigned> [disabled] [size=2]
	Capabilities: [40] Power Management version 3
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
	Capabilities: [70] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [140] Device Serial Number 00-00-00-00-00-00-00-00
	Capabilities: [150] Latency Tolerance Reporting
	Kernel driver in use: mt7603e

It's hard to keep track of who is using the staging PCI driver and who is not.

Anyway, can we start to make a list of routers along with the mt76 IRQs? The relevant numbers are in column 8 of /proc/interrupts . They are 4, 24, and 25 with 7 added to each, so 11, 31, 32.

edit: I am also interested in people that can get wifi working with the staging driver by changing the DTS files like this.

I do not see 4 here, just 24 and 25, zbt we1326 that is

Forgive my newbness, but here's /proc/interrupts from a Netgear R6220 running Netgear's latest firmware:

# cat interrupts
           CPU0       CPU1
  3:        275          0        MIPS GIC  eth2
  4:        195       1634        MIPS GIC  rai0
  7:      28429      29099        MIPS GIC  timer
 12:          0          0        MIPS GIC  ralink_gpio
 18:          0          0        MIPS GIC  Ralink_SPDIF
 22:          0          0        MIPS GIC  xhci-hcd:usb1
 23:          3          0        MIPS GIC  Ralink_ESW
 25:        438       3267        MIPS GIC  ra0
 26:      68936          0        MIPS GIC  serial
 56:       2265          0        MIPS GIC  IPI_resched
 57:          0       2611        MIPS GIC  IPI_resched
 58:          0          0        MIPS GIC  IPI_resched
 59:          0          0        MIPS GIC  IPI_resched
 60:       1537          0        MIPS GIC  IPI_call
 61:          0       1697        MIPS GIC  IPI_call
 62:          0          0        MIPS GIC  IPI_call
 63:          0          0        MIPS GIC  IPI_call

ERR:          0

and here it is when running openwrt snapshot (r7068-2087df1) downloaded just now:

# cat interrupts
           CPU0       CPU1
  8:      12485      12462  MIPS GIC Local   1  timer
  9:        815          0  MIPS GIC  63  IPI call
 10:          0       1182  MIPS GIC  64  IPI call
 11:       1348          0  MIPS GIC  65  IPI resched
 12:          0       1367  MIPS GIC  66  IPI resched
 14:         12          0  MIPS GIC  33  ttyS0
 15:         19          0  MIPS GIC  29  xhci-hcd:usb1
 16:        610          0  MIPS GIC  10  1e100000.ethernet
 17:          1          0  MIPS GIC  30  gsw
 19:          2          0  MIPS GIC  11  mt76x2e
ERR:          0

How do we know if we are using the staging PCI driver? I have commit 7197744cd677c9dbb387c3e93be0419292fb9307

Here's my lspci

00:00.0 PCI bridge: Device 0e8d:0801 (rev 01)
00:01.0 PCI bridge: Device 0e8d:0801 (rev 01)
01:00.0 Network controller: MEDIATEK Corp. Device 7603
02:00.0 Network controller: MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter

And cat /proc/interrupts

 24:         23          0          0          0  MIPS GIC  31  mt7603e
 25:          2          0          0          0  MIPS GIC  32  mt76x2e

On 18.06 snapshot r6995-ba204d9

cat /proc/interrupts

 24:         22          0          0          0  MIPS GIC  31  mt7603e
 25:          2          0          0          0  MIPS GIC  32  mt76x2e

lspci

00:00.0 PCI bridge: Device 0e8d:0801 (rev 01)
00:01.0 PCI bridge: Device 0e8d:0801 (rev 01)
01:00.0 Network controller: MEDIATEK Corp. Device 7603
02:00.0 Network controller: MEDIATEK Corp. MT7662E 802.11ac PCI Express Wireless Network Adapter

uname -a

Linux OpenWrt 4.14.43 #0 SMP Fri Jun 1 19:03:27 2018 mips GNU/Linux

System log:

Fri Jun  1 23:01:51 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy0.conf
Fri Jun  1 23:01:51 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Fri Jun  1 23:01:51 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 23:01:51 2018 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->DISABLED
Fri Jun  1 23:01:51 2018 daemon.notice hostapd: wlan0: AP-DISABLED
Fri Jun  1 23:01:51 2018 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Fri Jun  1 23:01:51 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Fri Jun  1 23:01:51 2018 daemon.notice netifd: radio0 (2518): cat: can't open '/var/run/wifi-phy0.pid': No such file or directory
Fri Jun  1 23:01:51 2018 daemon.notice netifd: radio0 (2518): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 23:01:51 2018 daemon.notice netifd: radio0 (2518): Command failed: Invalid argument
Fri Jun  1 23:01:51 2018 daemon.notice netifd: radio0 (2518): Device setup failed: HOSTAPD_START_FAILED
Fri Jun  1 23:02:24 2018 daemon.err hostapd: Configuration file: /var/run/hostapd-phy1.conf
Fri Jun  1 23:02:24 2018 daemon.notice hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Fri Jun  1 23:02:24 2018 daemon.err hostapd: nl80211 driver initialization failed.
Fri Jun  1 23:02:24 2018 daemon.notice hostapd: wlan1: interface state UNINITIALIZED->DISABLED
Fri Jun  1 23:02:24 2018 daemon.notice hostapd: wlan1: AP-DISABLED
Fri Jun  1 23:02:24 2018 daemon.notice hostapd: wlan1: CTRL-EVENT-TERMINATING
Fri Jun  1 23:02:24 2018 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan1 wasn't started
Fri Jun  1 23:02:24 2018 daemon.notice netifd: radio1 (4033): cat: can't open '/var/run/wifi-phy1.pid': No such file or directory
Fri Jun  1 23:02:24 2018 daemon.notice netifd: radio1 (4033): WARNING (wireless_add_process): executable path /usr/sbin/wpad does not match process  path ()
Fri Jun  1 23:02:24 2018 daemon.notice netifd: radio1 (4033): Command failed: Invalid argument
Fri Jun  1 23:02:24 2018 daemon.notice netifd: radio1 (4033): Device setup failed: HOSTAPD_START_FAILED

If it goes from 16 to 18, it's staging. 16 to 19 is stock IIRC. master has it reverted.

The ramips-mt76 revert patches are now in openwrt-18.06 branch, just built and tested on zbt1326 and both 2.4G/5G are working.

Snapshot r7093-4fdc6ca31b installed on Netgear R6220 and both 2.4GHz and 5GHz WiFi are working.

What do you mean?

after about 20+ reboots it no longer reboots reliably, not even into recovery mode, I then solder the uart and found either the kernel boots half-way and die, or nothing coming out of the uart at all, it's dead/unusable after 2 days. -- update, after a fresh rebuild it boots up fine, it could be my build-env is not distclean-ed after so many rebuilds.