Skip to content

mt7915e driver fails to load on Raspberry Pi 5 with error -12 (ENOMEM) #7026

@NameLess0974

Description

@NameLess0974

Describe the bug

mt7915e driver fails to load on Raspberry Pi 5 with error -12 (ENOMEM) on kernel 6.17.

I'm experiencing a problem with the mt7915e driver for my MediaTek 7906 card (Wi-Fi 6E AX3000 Mini PCIe Module AW7916-NPD) on a Raspberry Pi 5. The driver fails with error -12 (ENOMEM) despite increasing CMA memory to 256MB. This card worked with a custom DMA overlay on kernel 6.6 but fails on 6.17+.

The key issue appears to be DMA-related as BusMaster is disabled in the PCI configuration, and error logs point to memory allocation failures despite having sufficient CMA memory available.

Steps to reproduce the behaviour

  1. Install Raspberry Pi OS on Raspberry Pi 5
  2. Update to kernel 6.17.0-rc3-v8-16k+ with mt7915e module enabled
  3. Set cmdline parameters including cma=256M in /boot/firmware/cmdline.txt
  4. Apply custom DMA overlay that worked on kernel 6.6
  5. Reboot system
  6. Observe that the WiFi card is detected but the driver fails to initialize with error -12 (ENOMEM)

Additional steps already tried (all failed):

  • Tested different CMA values: 256M, 512M - always same error -12
  • Tested overlays: pcie-32bit-dma.dtbo, pcie-32bit-dma-pi5.dtbo, pciex1-compat-pi5.dtbo
  • Modified parameters: iommu.strict=0, iommu.passthrough=0, dma_debug=off
  • Disabled driver features: wed_enable=0, sr_scene_detect=0
  • Created udev rule to limit DMA mask to 32-bit and 16-bit

Device (s)

Raspberry Pi 5

System

  • Hardware: Raspberry Pi 5 Model B Rev 1.0
  • WiFi Card: Wi-Fi 6E AX3000 Mini PCIe Module AW7916-NPD with MediaTek MT7916AN chipset
  • Kernel: 6.17.0-rc3-v8-16k+
  • Distribution: Raspberry Pi OS
  • Current cmdline: console=serial0,115200 console=tty1 root=PARTUUID=4490a5f7-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles dma_debug=off iommu.strict=0 iommu.passthrough=0 cma=256M

The reason for upgrading from kernel 6.6 to 6.17 was that on 6.6, while the card was detected, it caused:

  • System load spikes exceeding 10-15
  • Complete unresponsiveness during WiFi activity
  • Regular crashes when using the WiFi module

Logs

Driver Error

[ 215.622453] mt7915e 0001:01:00.0: disabling ASPM L1
[ 215.667923] mt7915e 0001:01:00.0: probe with driver mt7915e failed with error -12

CMA Configuration

CmaTotal: 262144 kB
CmaFree: 250752 kB

udev Error

Sep 01 11:03:02 raspberrypi (udev-worker)[330]: 0001:01:00.0: /etc/udev/rules.d/99-pcie-dma-limit.rules:2 Failed to write ATTR{/sys/devices/platform/axi/1000110000.pcie/pci0001:00/0001:00:00.0/0001:01:00.0/dm_mask_bits}, ignoring: Permission denied

PCI Device Information

0001:01:00.0 Network controller: MEDIATEK Corp. Device 7906
Subsystem: MEDIATEK Corp. Device 7906
Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 38
Region 0: Memory at 1800000000 (64-bit, prefetchable) [size=1M]
Region 2: Memory at 1b80000000 (64-bit, non-prefetchable) [size=32K]
Region 4: Memory at 1800100000 (64-bit, prefetchable) [size=4K]
Capabilities: [80] Express (v2) Endpoint, MSI 00
Kernel modules: mt7915e

binfmt_misc 65536 1
mt7915e 196608 0
mt76_connac_lib 114688 1 mt7915e
mt76 163840 2 mt7915e,mt76_connac_lib
mac80211 1163264 3 mt76,mt7915e,mt76_connac_lib
cfg80211 1114112 6 mt76,brcmfmac_cyw,mt7915e,brcmfmac,mac80211,mt76_connac_lib
reboot=w coherent_pool=1M 8250.nr_uarts=1 pci=pcie_bus_safe cgroup_disable=memory numa_policy=interleave nvme.max_host_mem_size_mb=0 smsc95xx.macaddr=2C:CF:67:87:2B:EC vc_mem.mem_base=0x3fc00000 vc_mem.mem_size=0x40000000 console=ttyAMA10,115200 console=tty1 root=PARTUUID=4490a5f7-02 rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles dma_debug=off iommu.strict=0 iommu.passthrough=0 cma=256M

Additional context

  1. Raspberry Pi 5 Model B Rev 1.0
  2. Wi-Fi 6E AX3000 Mini PCIe Module AW7916-NPD
    • MediaTek MT7916AN chipset (PCI ID: 14c3:7906)
    • Supports Wi-Fi 6E 3000 and DBDC
    • High performance card with 6E capabilities

DMA overlay that worked on kernel 6.6:

/dts-v1/;
/ {
        compatible = "brcm,bcm2712";
        fragment@0 {
                target = <0xffffffff>;
                __overlay__ {
                        #address-cells = <0x03>;
                        #size-cells = <0x02>;
                        dma-ranges = <0x2000000 0x00 0x00 0x00 0x00 0x00 0x80000000>;
                };
        };
        __fixups__ {
                pcie1 = "/fragment@0:target:0";
        };
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions