MT7921k card not auto-detected

Hey folks,

so I bought a MT7921k wi-fi card and installed the following drivers and firmware:

kmod-mt76-connac

kmod-mt7921-firmware	

kmod-mt76-core

kmod-mt7921-common

kmod-mt7921e

kmod-mt792x-common

including

wpad

wpad-wolfssl

pciutils

lspci shows the following:

0000:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0000:01:00.0 Network controller: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter
0001:00:00.0 PCI bridge: Broadcom Inc. and subsidiaries BCM2712 PCIe Bridge (rev 21)
0001:01:00.0 Ethernet controller: Raspberry Pi Ltd RP1 PCIe 2.0 South Bridge

So the device itself is being recognized by PCIe, however when I'm booting up no radio interface is being created. I also tried a different card by atheros, upon of course installing all the required drivers and firmware, and I got the same result: card shows up on lspci but not in Luci.

I'm using OpenWrt SNAPSHOT (r27433-7e1d092552) for the Pi5.

EDIT: when running dmesg I noticed the following

[    6.195953] mt7921e 0000:01:00.0: enabling device (0000 -> 0002)
[    6.220371] mt7921e 0000:01:00.0: ASIC revision: 79610010
[    6.307702] mt7921e: probe of 0000:01:00.0 failed with error -12

Thank you for your help guys

lspci -nnk

i.e show PCI IDs and kernel module in full.

ok, that's the output for lspci -nnk

0000:01:00.0 Network controller [0280]: MEDIATEK Corp. MT7921 802.11ax PCI Express Wireless Network Adapter [14c3:7961]
        Subsystem: AzureWave Device [1a3b:4680]

That is about kmalloc failing or device mapping not allocated.
Can you show

cat /proc/iomem

For device allocations (it is not memory, it is address space, dont be scared)

Uninstall firmware and do a cold poweron, then rmmod and imodprobe of the driver.
And then rmmod and modprobe mt7921e disable_aspm=1
Do the error messages change?

so you mean uninstall kmod-mt7921-firmware and leave kmod-mt7921e ?

in the meanwhile that's the cat /proc/iomem output:

00000000-0007ffff : reserved
00080000-3fbfffff : System RAM
  00210000-00dfffff : Kernel code
  00e00000-00e7ffff : reserved
  00e80000-0100ffff : Kernel data
  01400000-053fffff : reserved
  2efec000-2effffff : reserved
40000000-ffffffff : System RAM
  fb000000-ff5fffff : reserved
  ff740000-ff740fff : reserved
  ff741000-ff788fff : reserved
  ff78b000-ff78bfff : reserved
  ff78c000-ff78cfff : reserved
  ff78d000-ff79efff : reserved
  ff79f000-ffffffff : reserved
1000005100-100000517f : 1000005100.iommu iommu@5100
1000005200-100000527f : 1000005200.iommu iommu@5200
1000005280-10000052ff : 1000005280.iommu iommu@5280
1000005b00-1000005b7f : 1000005b00.iommuc iommuc@5b00
1000010000-10000105ff : 1000010000.dma dma@10000
1000010600-1000010bff : 1000010600.dma dma@10600
1000110000-100011930f : 1000110000.pcie pcie@110000
1000119500-100011950f : 1000119500.reset-controller reset-controller@119500
1000120000-100012930f : 1000120000.pcie pcie@120000
1000fff000-1000fff25f : 1000fff000.mmc host
1000fff400-1000fff5ff : 1000fff000.mmc cfg
1001100000-100110025f : 1001100000.mmc host
1001100400-10011005ff : 1001100000.mmc cfg
10015040b0-10015040b3 : 1000fff000.mmc busisol
1001504318-1001504347 : 1001504318.reset-controller reset-controller@1504318
10015200f0-1001520113 : 1000fff000.mmc lcpll
107c013880-107c0138bf : 107c013880.mailbox mailbox@7c013880
107c700000-107c70000f : 107c700000.clock clock@7c700000
107d001000-107d0011ff : serial@7d001000
  107d001000-107d0011ff : 107d001000.serial serial@7d001000
107d200000-107d200307 : 107d200000.watchdog pm
107d208000-107d208027 : 107d208000.rng rng@7d208000
107d504100-107d50412f : 107d504100.pinctrl pinctrl@7d504100
107d508500-107d50853f : 107d508500.gpio gpio@7d508500
107d50c000-107d50c01f : serial
107d510700-107d51071f : 107d510700.pinctrl pinctrl@7d510700
107d517a80-107d517aa7 : 107d517a80.pwm pwm@7d517a80
107d517c00-107d517c3f : 107d517c00.gpio gpio@7d517c00
1800000000-1affffffff : pcie@110000
  1800000000-18001fffff : PCI Bus 0000:01
    1800000000-18000fffff : 0000:01:00.0
    1800100000-1800103fff : 0000:01:00.0
    1800104000-1800104fff : 0000:01:00.0
1b00000000-1bfffffffb : pcie@110000
1c00000000-1effffffff : pcie@120000
1f00000000-1ffffffffb : pcie@120000
  1f00000000-1f005fffff : PCI Bus 0001:01
    1f00000000-1f003fffff : 0001:01:00.0
      1f00018000-1f00028037 : 1f00018000.clocks clocks@18000
      1f000d0000-1f000dbfff : 1f000d0000.gpio gpio@d0000
      1f000e0000-1f000ebfff : 1f000d0000.gpio gpio@d0000
      1f000f0000-1f000fbfff : 1f000d0000.gpio gpio@d0000
      1f00100000-1f00103fff : 1f00100000.ethernet ethernet@100000
      1f00200000-1f00207fff : usb@200000
        1f00200000-1f00207fff : xhci-hcd.0 usb@200000
      1f0020c100-1f002fffff : 1f00200000.usb usb@200000
      1f00300000-1f00307fff : usb@300000
        1f00300000-1f00307fff : xhci-hcd.1 usb@300000
      1f0030c100-1f003fffff : 1f00300000.usb usb@300000
    1f00400000-1f0040ffff : 0001:01:00.0
    1f00410000-1f00413fff : 0001:01:00.0

Yes, uninstall firmware, if PCIE device inits it will print missing filename and we will get it from upstream in its latrst version.

problem is when I'm uninstalling kmod-mt7921-firmware the package kmod-mt7921e is automatically uninstalled (altough box to automatically uninstall dependencies is not ticked), apparently I can only have kmod-mt7921e installed together with the firmware.

What remains however is

kmod-mt76-connac

kmod-mt76-core

kmod-mt792x-common

OK, does not matter, try modprobe with parameter if error message changes.

Ok, so I did rmmod mt7921e and then modprobe mt7921e disable_aspm=1

same error appears in dmesg and logread:

[  123.903094] mt7921e 0000:01:00.0: ASIC revision: 79610010
[  123.997934] mt7921e: probe of 0000:01:00.0 failed with error -12

Check with raspbian how pci device spaces are set up and how the driver loads....

Funny thing is I also used an Intel card once on the same device and it worked exactly as it should... auto-detected and radio interface auto generated by OpenWrt.

Strange...

Also, I just did another check with a different card made by Atheros (QCA6174) and this is what was to be found in the dmesg error log:

[    6.201698] ath10k_pci 0000:01:00.0: failed to alloc CE src ring 0: -12
[    6.208379] ath10k_pci 0000:01:00.0: failed to allocate copy engine pipe 0: -                                                                                12
[    6.215714] ath10k_pci 0000:01:00.0: failed to allocate copy engine pipes: -1                                                                                2
[    6.222963] ath10k_pci 0000:01:00.0: failed to setup resource: -12
[    6.229192] ath10k_pci: probe of 0000:01:00.0 failed with error -12

Idk if it's useful but I posted it just in case it helps to solve this problem....

I think I fixed it !

After googling the error message above a little bit I found an older post suggesting to add dtoverlay=pcie-32bit-dma to /boot/config.txt in OpenWrt, however if you're using a RPi Pi5 you should use dtoverlay=pcie-32bit-dma-pi5.
This, from what I understand, causes the address allocation to be made in 32bit bit instead of 64bit (?). My previously mentioned Intel card seems to not have the same problem and is apparently able to take 64bit (I presume) address allocations.

Now for both cards the radio interface is being auto-generated and I'm testing AP mode now.

Update: AP mode works fine just tested it.

Other way around, older cards map less address space.

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